Skip to content

The agent that grows with you

fix(providers): LM Studio and TokenHub profiles declare their credential env vars

Tekniumbc246e1f8ac8
diff --git a/plugins/model-providers/lmstudio/__init__.py b/plugins/model-providers/lmstudio/__init__.py
index ac98865714a..0a1acd44bea 100644
--- a/plugins/model-providers/lmstudio/__init__.py
+++ b/plugins/model-providers/lmstudio/__init__.py
@@ -39,4 +39,5 @@ class LMStudioProfile(ProviderProfile):
register_provider(LMStudioProfile(
name="lmstudio", display_name="LM Studio", supports_model_listing=False, supports_health_check=False,
+ env_vars=("LM_API_KEY", "LM_BASE_URL"),
))
diff --git a/plugins/model-providers/tencent-tokenhub/__init__.py b/plugins/model-providers/tencent-tokenhub/__init__.py
index 92de59c7df9..ead16f6424a 100644
--- a/plugins/model-providers/tencent-tokenhub/__init__.py
+++ b/plugins/model-providers/tencent-tokenhub/__init__.py
@@ -36,4 +36,5 @@ class TokenHubProfile(ProviderProfile):
register_provider(TokenHubProfile(
name="tencent-tokenhub", display_name="Tencent TokenHub", supports_health_check=False,
+ env_vars=("TOKENHUB_API_KEY", "TOKENHUB_BASE_URL"),
))
diff --git a/tests/e2e/core/providers/_catalog_helpers.py b/tests/e2e/core/providers/_catalog_helpers.py
index c9640b62387..45f57c13483 100644
--- a/tests/e2e/core/providers/_catalog_helpers.py
+++ b/tests/e2e/core/providers/_catalog_helpers.py
@@ -141,6 +141,9 @@ class Row:
out[p + "/models"] = "listing"
if self.dialect == "anthropic":
out[p + "/v1/models"] = "listing"
+ if self.name == "lmstudio":
+ # LM Studio validates and lists through its NATIVE ``/api/v1/models`` at the server root.
+ out[f"/{self.name}/api/v1/models"] = "listing"
return out
def listing_routes(self) -> set[str]:
diff --git a/tests/fakes/providers/catalog_fake.py b/tests/fakes/providers/catalog_fake.py
index cfa54c8b3c5..c6c0da57031 100644
--- a/tests/fakes/providers/catalog_fake.py
+++ b/tests/fakes/providers/catalog_fake.py
@@ -311,10 +311,11 @@ def _handler_for(fake: CatalogFake) -> type[BaseHTTPRequestHandler]:
if fake.models_status != 200:
self._json(fake.models_status, {"error": {"message": "no listing here"}})
return
- self._json(200, {"object": "list", "data": [
- {"id": m, "object": "model", "type": "model", "display_name": m, "created": 1,
- "created_at": "2026-01-01T00:00:00Z", "owned_by": "catalog", "context_length": 131072}
- for m in fake.models]})
+ rows = [{"id": m, "object": "model", "type": "model", "display_name": m, "created": 1,
+ "created_at": "2026-01-01T00:00:00Z", "owned_by": "catalog", "context_length": 131072}
+ for m in fake.models]
+ # ``models`` is LM Studio's native listing key; OpenAI-shaped readers ignore it.
+ self._json(200, {"object": "list", "data": rows, "models": rows})
def do_POST(self) -> None: # noqa: N802
raw = self.rfile.read(int(self.headers.get("Content-Length", 0) or 0))