llama-stack-mirror/tests/unit/providers
mergify[bot] 05b4394cf9
fix: enforce allowed_models during inference requests (backport #4197) (#4228)
The `allowed_models` configuration was only being applied when listing
models via the `/v1/models` endpoint, but the actual inference requests
weren't checking this restriction. This meant users could directly
request any model the provider supports by specifying it in their
inference call, completely bypassing the intended cost controls.

The fix adds validation to all three inference methods (chat
completions, completions, and embeddings) that checks the requested
model against the allowed_models list before making the provider API
call.

### Test plan

Added unit tests <hr>This is an automatic backport of pull request #4197
done by [Mergify](https://mergify.com).

Signed-off-by: Charlie Doern <cdoern@redhat.com>
Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
2025-11-24 11:31:36 -08:00
..
agent feat(stores)!: use backend storage references instead of configs (#3697) 2025-10-20 13:20:09 -07:00
agents feat(stores)!: use backend storage references instead of configs (#3697) 2025-10-20 13:20:09 -07:00
batches feat(stores)!: use backend storage references instead of configs (#3697) 2025-10-20 13:20:09 -07:00
files feat(stores)!: use backend storage references instead of configs (#3697) 2025-10-20 13:20:09 -07:00
inference fix(tests): reduce some test noise (#3825) 2025-10-16 09:52:16 -07:00
inline feat: Add responses and safety impl extra_body (#3781) 2025-10-15 15:01:37 -07:00
nvidia fix(tests): reduce some test noise (#3825) 2025-10-16 09:52:16 -07:00
utils fix: enforce allowed_models during inference requests (backport #4197) (#4228) 2025-11-24 11:31:36 -08:00
vector_io fix: Vector store persistence across server restarts (backport #3977) (#4225) 2025-11-24 11:30:21 -08:00
test_bedrock.py fix: AWS Bedrock inference profile ID conversion for region-specific endpoints (#3386) 2025-09-11 11:41:53 +02:00
test_configs.py chore(rename): move llama_stack.distribution to llama_stack.core (#2975) 2025-07-30 23:30:53 -07:00