llama-stack-mirror/llama_stack/providers/remote/inference
Sébastien Han 43c1f39bd6
refactor(env)!: enhanced environment variable substitution (#2490)
# What does this PR do?

This commit significantly improves the environment variable substitution
functionality in Llama Stack configuration files:
* The version field in configuration files has been changed from string
to integer type for better type consistency across build and run
configurations.

* The environment variable substitution system for ${env.FOO:} was fixed
and properly returns an error

* The environment variable substitution system for ${env.FOO+} returns
None instead of an empty strings, it better matches type annotations in
config fields

* The system includes automatic type conversion for boolean, integer,
and float values.

* The error messages have been enhanced to provide clearer guidance when
environment variables are missing, including suggestions for using
default values or conditional syntax.

* Comprehensive documentation has been added to the configuration guide
explaining all supported syntax patterns, best practices, and runtime
override capabilities.

* Multiple provider configurations have been updated to use the new
conditional syntax for optional API keys, making the system more
flexible for different deployment scenarios. The telemetry configuration
has been improved to properly handle optional endpoints with appropriate
validation, ensuring that required endpoints are specified when their
corresponding sinks are enabled.

* There were many instances of ${env.NVIDIA_API_KEY:} that should have
caused the code to fail. However, due to a bug, the distro server was
still being started, and early validation wasn’t triggered. As a result,
failures were likely being handled downstream by the providers. I’ve
maintained similar behavior by using ${env.NVIDIA_API_KEY:+}, though I
believe this is incorrect for many configurations. I’ll leave it to each
provider to correct it as needed.

* Environment variable substitution now uses the same syntax as Bash
parameter expansion.

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-06-26 08:20:08 +05:30
..
anthropic chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
bedrock feat: New OpenAI compat embeddings API (#2314) 2025-05-31 22:11:47 -07:00
cerebras feat: New OpenAI compat embeddings API (#2314) 2025-05-31 22:11:47 -07:00
cerebras_openai_compat feat: introduce APIs for retrieving chat completion requests (#2145) 2025-05-18 21:43:19 -07:00
databricks feat: New OpenAI compat embeddings API (#2314) 2025-05-31 22:11:47 -07:00
fireworks chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
fireworks_openai_compat feat: introduce APIs for retrieving chat completion requests (#2145) 2025-05-18 21:43:19 -07:00
gemini chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
groq chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
groq_openai_compat feat: introduce APIs for retrieving chat completion requests (#2145) 2025-05-18 21:43:19 -07:00
llama_openai_compat feat: introduce APIs for retrieving chat completion requests (#2145) 2025-05-18 21:43:19 -07:00
nvidia refactor(env)!: enhanced environment variable substitution (#2490) 2025-06-26 08:20:08 +05:30
ollama refactor(env)!: enhanced environment variable substitution (#2490) 2025-06-26 08:20:08 +05:30
openai chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
passthrough chore: remove nested imports (#2515) 2025-06-26 08:01:05 +05:30
runpod refactor(env)!: enhanced environment variable substitution (#2490) 2025-06-26 08:20:08 +05:30
sambanova fix(providers): update sambanova json schema mode (#2306) 2025-05-29 09:54:23 -07:00
sambanova_openai_compat feat: introduce APIs for retrieving chat completion requests (#2145) 2025-05-18 21:43:19 -07:00
tgi feat: New OpenAI compat embeddings API (#2314) 2025-05-31 22:11:47 -07:00
together refactor(env)!: enhanced environment variable substitution (#2490) 2025-06-26 08:20:08 +05:30
together_openai_compat feat: introduce APIs for retrieving chat completion requests (#2145) 2025-05-18 21:43:19 -07:00
vllm refactor(env)!: enhanced environment variable substitution (#2490) 2025-06-26 08:20:08 +05:30
watsonx refactor(env)!: enhanced environment variable substitution (#2490) 2025-06-26 08:20:08 +05:30
__init__.py impls -> inline, adapters -> remote (#381) 2024-11-06 14:54:05 -08:00