llama-stack-mirror/llama_stack/providers/utils
Kai Wu e3fd70c321
fix: change ModelRegistryHelper to use ProviderModelEntry instead of hardcoded ModelType.llm (#3451)
# What does this PR do?
<!-- Provide a short summary of what this PR does and why. Link to
relevant issues if applicable. -->
change ModelRegistryHelper to use ProviderModelEntry instead of
hardcoded ModelType.llm which fixed issue #3330.
<!-- If resolving an issue, uncomment and update the line below -->
<!-- Closes #[3330] -->

## Test Plan
<!-- Describe the tests you ran to verify your changes with result
summaries. *Provide clear instructions so the plan can be easily
re-executed.* -->
1. open llama-stack server 
```
uv sync --python 3.12
source .venv/bin/activate
uv run llama stack build --distro starter --image-type venv  --run
```
2.Used following script to test 
```
from llama_stack_client import LlamaStackClient
import os
def test_openai_embedding_type():
    client = LlamaStackClient(
        base_url=os.environ.get("LLAMA_STACK_ENDPOINT", "http://localhost:8321"),
        provider_data={
        "openai_api_key": os.environ.get("OPENAI_API_KEY", ""),
    },
    )
    model = client.models.retrieve("openai/text-embedding-3-small")
    print(model)
    assert model.identifier == "openai/text-embedding-3-small"
    assert model.model_type == "embedding"
test_openai_embedding_type()
```
logs:
```
python test_openai.py
INFO:httpx:HTTP Request: GET http://localhost:8321/v1/models/openai/text-embedding-3-small "HTTP/1.1 200 OK"
Model(identifier='openai/text-embedding-3-small', metadata={'embedding_dimension': 1536.0, 'context_length': 8192.0}, api_model_type='embedding', provider_id='openai', type='model', provider_resource_id='text-embedding-3-small', owner=None, source='listed_from_provider', model_type='embedding')
```
2025-09-22 12:55:32 -04:00
..
bedrock fix: use lambda pattern for bedrock config env vars (#3307) 2025-09-05 10:45:11 +02:00
common chore(rename): move llama_stack.distribution to llama_stack.core (#2975) 2025-07-30 23:30:53 -07:00
datasetio chore(misc): make tests and starter faster (#3042) 2025-08-05 14:55:05 -07:00
inference fix: change ModelRegistryHelper to use ProviderModelEntry instead of hardcoded ModelType.llm (#3451) 2025-09-22 12:55:32 -04:00
kvstore refactor(logging): rename llama_stack logger categories (#3065) 2025-08-21 17:31:04 -07:00
memory chore(migrate apis): move VectorDBWithIndex from embeddings to openai_embeddings (#3294) 2025-08-31 14:48:35 -07:00
responses chore: simplify authorized sqlstore (#3496) 2025-09-19 16:13:56 -07:00
scoring chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
sqlstore chore: simplify authorized sqlstore (#3496) 2025-09-19 16:13:56 -07:00
telemetry chore: logging perf improvments (#3393) 2025-09-10 11:52:23 -07:00
tools fix: show descriptive MCP server connection errors instead of generic 500s (#3256) 2025-09-04 13:25:02 -07:00
vector_io feat: migrate to FIPS-validated cryptographic algorithms (#3423) 2025-09-12 11:18:19 +02:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
pagination.py chore(refact): move paginate_records fn outside of datasetio (#2137) 2025-05-12 10:56:14 -07:00
scheduler.py refactor(logging): rename llama_stack logger categories (#3065) 2025-08-21 17:31:04 -07:00