mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
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 |
||
|---|---|---|
| .. | ||
| inference | ||
| memory | ||
| __init__.py | ||
| test_form_data.py | ||
| test_model_registry.py | ||
| test_openai_compat_conversion.py | ||
| test_scheduler.py | ||