mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-16 08:59:26 +00:00
fix: improve model availability checks
- Add has_model method to ModelsRoutingTable for checking pre-registered models - Update check_model_availability to check model_store before provider APIs
This commit is contained in:
parent
696fefbf17
commit
0d5ce21764
4 changed files with 64 additions and 4 deletions
|
|
@ -201,6 +201,12 @@ async def test_models_routing_table(cached_disk_dist_registry):
|
|||
non_existent = await table.get_object_by_identifier("model", "non-existent-model")
|
||||
assert non_existent is None
|
||||
|
||||
# Test has_model
|
||||
assert await table.has_model("test_provider/test-model")
|
||||
assert await table.has_model("test_provider/test-model-2")
|
||||
assert not await table.has_model("non-existent-model")
|
||||
assert not await table.has_model("test_provider/non-existent-model")
|
||||
|
||||
await table.unregister_model(model_id="test_provider/test-model")
|
||||
await table.unregister_model(model_id="test_provider/test-model-2")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue