llama-stack-mirror/llama_stack/providers/utils
Ashwin Bharambe 84ffcb8c2b fix(inference): enable routing of models with provider_data alone (#3928)
This PR enables routing of fully qualified model IDs of the form
`provider_id/model_id` even when the models are not registered with the
Stack.

Here's the situation: assume a remote inference provider which works
only when users provide their own API keys via
`X-LlamaStack-Provider-Data` header. By definition, we cannot list
models and hence update our routing registry. But because we _require_ a
provider ID in the models now, we can identify which provider to route
to and let that provider decide.

Note that we still try to look up our registry since it may have a
pre-registered alias. Just that we don't outright fail when we are not
able to look it up.

Also, updated inference router so that the responses have the _exact_
model that the request had.

Added an integration test

Closes #3929

---------

Co-authored-by: ehhuang <ehhuang@users.noreply.github.com>
2025-11-12 13:34:30 -08:00
..
bedrock feat: use SecretStr for inference provider auth credentials (#3724) 2025-10-10 07:32:50 -07: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
files fix(expires_after): make sure multipart/form-data is properly parsed (#3612) 2025-09-30 16:14:03 -04:00
inference fix(inference): enable routing of models with provider_data alone (#3928) 2025-11-12 13:34:30 -08:00
kvstore feat(stores)!: use backend storage references instead of configs (#3697) 2025-10-20 13:20:09 -07:00
memory fix: remove consistency checks (#3881) 2025-10-21 14:40:14 -07:00
responses fix: harden storage semantics (backport #4118) (#4138) 2025-11-12 13:01:21 -08:00
scoring chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
sqlstore fix: harden storage semantics (backport #4118) (#4138) 2025-11-12 13:01:21 -08:00
telemetry test(telemetry): Telemetry Tests (#3805) 2025-10-17 10:43:33 -07:00
tools feat(tools)!: substantial clean up of "Tool" related datatypes (#3627) 2025-10-02 15:12:03 -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