mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-14 16:52:37 +00:00
feat: Add allow_listing_models
• Add allow_listing_models configuration flag to VLLM provider to control model listing behavior • Implement allow_listing_models() method across all providers with default implementations in base classes • Prevent HTTP requests to /v1/models endpoint when allow_listing_models=false for improved security and performance • Fix unit tests to include allow_listing_models method in test classes and mock objects
This commit is contained in:
parent
188a56af5c
commit
e9214f9004
15 changed files with 143 additions and 25 deletions
|
|
@ -100,6 +100,9 @@ class ModelRegistryHelper(ModelsProtocolPrivate):
|
|||
async def should_refresh_models(self) -> bool:
|
||||
return False
|
||||
|
||||
async def allow_listing_models(self) -> bool:
|
||||
return True
|
||||
|
||||
def get_provider_model_id(self, identifier: str) -> str | None:
|
||||
return self.alias_to_provider_id_map.get(identifier, None)
|
||||
|
||||
|
|
|
|||
|
|
@ -425,3 +425,6 @@ class OpenAIMixin(ModelsProtocolPrivate, NeedsRequestProviderData, ABC):
|
|||
|
||||
async def should_refresh_models(self) -> bool:
|
||||
return False
|
||||
|
||||
async def allow_listing_models(self) -> bool:
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue