Support discovering gemini, anthropic, xai models by calling their /v1/model endpoint (#9530)

* fix: initial commit for adding provider model discovery to gemini

* feat(gemini/): add model discovery for gemini/ route

* docs(set_keys.md): update docs to show you can check available gemini models as well

* feat(anthropic/): add model discovery for anthropic api key

* feat(xai/): add model discovery for XAI

enables checking what models an xai key can call

* ci: bump ci config yml

* fix(topaz/common_utils.py): fix linting error

* fix: fix linting error for python38
This commit is contained in:
Krish Dholakia 2025-03-27 22:50:48 -07:00 committed by GitHub
parent 340a63bace
commit ccbac691e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 223 additions and 6 deletions

View file

@ -19,11 +19,19 @@ class BaseLLMModelInfo(ABC):
self,
model: str,
) -> Optional[ProviderSpecificModelInfo]:
"""
Default values all models of this provider support.
"""
return None
@abstractmethod
def get_models(self) -> List[str]:
pass
def get_models(
self, api_key: Optional[str] = None, api_base: Optional[str] = None
) -> List[str]:
"""
Returns a list of models supported by this provider.
"""
return []
@staticmethod
@abstractmethod