llama-stack-mirror/tests/unit/providers
Ashwin Bharambe 4645182789 fix: enforce allowed_models during inference requests (#4197)
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

(cherry picked from commit d649c3663e)

# Conflicts:
#	llama_stack/providers/utils/inference/openai_mixin.py
#	tests/unit/providers/utils/inference/test_openai_mixin.py
2025-11-24 19:05:08 +00: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 (#4197) 2025-11-24 19:05:08 +00:00
vector_io fix: remove consistency checks (#3881) 2025-10-21 14:40:14 -07: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