Skip to content

Commit 12c4a91

Browse files
authored
refactor: unify OpenAI model naming via Registry V2 conventions (#1084)
* refactor: unify OpenAI model naming via Registry V2 conventions Rename canonical model IDs to shorter, consistent names: - openai_compatible -> openai - async_openai_compatible_chat -> async_openai Old names preserved as backward-compatible aliases via new MODEL_ALIASES dict wired into _build_builtin_manifests(). File renames: - models/simple/openai_compatible.py -> models/simple/openai.py - models/chat/openai_compatible.py -> models/chat/openai.py * style: fix isort import formatting in chat/openai.py
1 parent dc4447c commit 12c4a91

7 files changed

Lines changed: 25 additions & 16 deletions

File tree

docs/current_tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ python -m lmms_eval --tasks list_with_num
522522
| `vllm_generate` | VLLMGenerate | vLLM generation mode |
523523
| `sglang` | Sglang | SGLang serving backend |
524524
| `huggingface` | Huggingface | Generic HuggingFace models |
525-
| `openai_compatible` | OpenAICompatible | OpenAI-compatible APIs |
526-
| `async_openai` | AsyncOpenAIChat | Async OpenAI chat |
525+
| `openai` | OpenAICompatible | OpenAI-compatible APIs (aliases: `openai_compatible`, `openai_compatible_chat`) |
526+
| `async_openai` | AsyncOpenAIChat | Async OpenAI chat (alias: `async_openai_compatible_chat`) |
527527

528528
### Simple/Legacy Models
529529
| Model Name | Class | Modality |

lmms_eval/models/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"mplug_owl_video": "mplug_Owl",
6464
"ola": "Ola",
6565
"omnivinci": "OmniVinci",
66-
"openai_compatible": "OpenAICompatible",
66+
"openai": "OpenAICompatible",
6767
"oryx": "Oryx",
6868
"phi3v": "Phi3v",
6969
"phi4_multimodal": "Phi4",
@@ -107,7 +107,7 @@
107107
"qwen3_vl": "Qwen3_VL",
108108
"qwen2_5_vl": "Qwen2_5_VL",
109109
"thyme": "Thyme",
110-
"openai_compatible": "OpenAICompatible",
110+
"openai": "OpenAICompatible",
111111
"vllm": "VLLM",
112112
"vllm_generate": "VLLMGenerate",
113113
"sglang": "Sglang",
@@ -117,6 +117,11 @@
117117
"llava_onevision1_5": "Llava_OneVision1_5",
118118
}
119119

120+
MODEL_ALIASES: dict[str, tuple[str, ...]] = {
121+
"openai": ("openai_compatible", "openai_compatible_chat"),
122+
"async_openai": ("async_openai_compatible_chat",),
123+
}
124+
120125

121126
def _build_class_path(
122127
model_name: str,
@@ -136,11 +141,13 @@ def _build_builtin_manifests() -> list[ModelManifest]:
136141
for model_id in model_ids:
137142
simple_class = AVAILABLE_SIMPLE_MODELS.get(model_id)
138143
chat_class = AVAILABLE_CHAT_TEMPLATE_MODELS.get(model_id)
144+
aliases = MODEL_ALIASES.get(model_id, ())
139145
manifests.append(
140146
ModelManifest(
141147
model_id=model_id,
142148
simple_class_path=(_build_class_path(model_id, "simple", simple_class) if simple_class else None),
143149
chat_class_path=(_build_class_path(model_id, "chat", chat_class) if chat_class else None),
150+
aliases=aliases,
144151
),
145152
)
146153
return manifests

lmms_eval/models/chat/async_openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
load_dotenv(verbose=True)
3232

3333

34-
@register_model("async_openai_compatible_chat")
34+
@register_model("async_openai")
3535
class AsyncOpenAIChat(lmms):
3636
is_simple = False
3737

lmms_eval/models/chat/openai_compatible.py renamed to lmms_eval/models/chat/openai.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
is_rate_limit_error,
1515
)
1616
from lmms_eval.models.model_utils.gen_metrics import log_metrics
17-
from lmms_eval.models.simple.openai_compatible import (
18-
OpenAICompatible as OpenAICompatibleSimple,
19-
)
17+
from lmms_eval.models.simple.openai import OpenAICompatible as OpenAICompatibleSimple
2018
from lmms_eval.protocol import ChatMessages
2119

2220
VideoReader, _ = optional_import("decord", "VideoReader")
@@ -25,7 +23,7 @@
2523
load_dotenv(verbose=True)
2624

2725

28-
@register_model("openai_compatible_chat")
26+
@register_model("openai")
2927
class OpenAICompatible(OpenAICompatibleSimple):
3028
is_simple = False
3129

lmms_eval/models/simple/openai_compatible.py renamed to lmms_eval/models/simple/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
load_dotenv(verbose=True)
3838

3939

40-
@register_model("openai_compatible")
40+
@register_model("openai")
4141
class OpenAICompatible(lmms):
4242
def __init__(
4343
self,

lmms_eval/tui/discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def get_popular_tasks() -> list[tuple[str, str]]:
122122

123123
def get_popular_models() -> list[tuple[str, str]]:
124124
return [
125-
("openai_compatible", "OpenAI Compatible API"),
125+
("openai", "OpenAI Compatible API"),
126126
("qwen2_5_vl", "Qwen2.5-VL"),
127127
("qwen2_5_vl_chat", "Qwen2.5-VL Chat"),
128128
("llava_onevision", "LLaVA-OneVision"),

test/eval/test_model_registry_v2.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def test_representative_aliases_are_resolvable(self):
7777
)
7878
registry.register_manifest(
7979
ModelManifest(
80-
model_id="openai_compatible",
81-
simple_class_path="lmms_eval.models.simple.openai_compatible.OpenAICompatible",
82-
chat_class_path="lmms_eval.models.chat.openai_compatible.OpenAICompatible",
83-
aliases=("openai_compatible_chat",),
80+
model_id="openai",
81+
simple_class_path="lmms_eval.models.simple.openai.OpenAICompatible",
82+
chat_class_path="lmms_eval.models.chat.openai.OpenAICompatible",
83+
aliases=("openai_compatible", "openai_compatible_chat"),
8484
),
8585
)
8686
registry.register_manifest(
@@ -94,7 +94,11 @@ def test_representative_aliases_are_resolvable(self):
9494
self.assertEqual(registry.resolve("vllm_chat").model_id, "vllm")
9595
self.assertEqual(
9696
registry.resolve("openai_compatible_chat").model_id,
97-
"openai_compatible",
97+
"openai",
98+
)
99+
self.assertEqual(
100+
registry.resolve("openai_compatible").model_id,
101+
"openai",
98102
)
99103
self.assertEqual(registry.resolve("sglang_runtime").model_id, "sglang")
100104

0 commit comments

Comments
 (0)