fix: allow default empty vars for conditionals (#2570)

# What does this PR do?

We were not using conditionals correctly, conditionals can only be used
when the env variable is set, so `${env.ENVIRONMENT:+}` would return
None is ENVIRONMENT is not set.

If you want to create a conditional value, you need to do
`${env.ENVIRONMENT:=}`, this will pick the value of ENVIRONMENT if set,
otherwise will return None.

Closes: https://github.com/meta-llama/llama-stack/issues/2564

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-07-01 14:42:05 +02:00 committed by GitHub
parent faaeccc6fd
commit 25268854bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 236 additions and 211 deletions

View file

@ -125,7 +125,7 @@ config:
``` ```
If the environment variable is not set, the default value `http://localhost:11434` will be used. If the environment variable is not set, the default value `http://localhost:11434` will be used.
Empty defaults are not allowed so `url: ${env.OLLAMA_URL:=}` will raise an error if the environment variable is not set. Empty defaults are allowed so `url: ${env.OLLAMA_URL:=}` will be set to `None` if the environment variable is not set.
#### Conditional Values #### Conditional Values
@ -139,8 +139,10 @@ config:
If the environment variable is set, the value after `:+` will be used. If it's not set, the field If the environment variable is set, the value after `:+` will be used. If it's not set, the field
will be omitted with a `None` value. will be omitted with a `None` value.
So `${env.ENVIRONMENT:+}` is supported, it means that the field will be omitted if the environment
variable is not set. It can be used to make a field optional and then enabled at runtime when desired. Do not use conditional values (`${env.OLLAMA_URL:+}`) for empty defaults (`${env.OLLAMA_URL:=}`).
This will be set to `None` if the environment variable is not set.
Conditional must only be used when the environment variable is set.
#### Examples #### Examples

View file

@ -16,7 +16,7 @@ NVIDIA's dataset I/O provider for accessing datasets from NVIDIA's data platform
## Sample Configuration ## Sample Configuration
```yaml ```yaml
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default} dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default}
project_id: ${env.NVIDIA_PROJECT_ID:=test-project} project_id: ${env.NVIDIA_PROJECT_ID:=test-project}
datasets_url: ${env.NVIDIA_DATASETS_URL:=http://nemo.test} datasets_url: ${env.NVIDIA_DATASETS_URL:=http://nemo.test}

View file

@ -17,7 +17,7 @@ NVIDIA inference provider for accessing NVIDIA NIM models and AI services.
```yaml ```yaml
url: ${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com} url: ${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com}
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
append_api_version: ${env.NVIDIA_APPEND_API_VERSION:=True} append_api_version: ${env.NVIDIA_APPEND_API_VERSION:=True}
``` ```

View file

@ -14,8 +14,8 @@ RunPod inference provider for running models on RunPod's cloud GPU platform.
## Sample Configuration ## Sample Configuration
```yaml ```yaml
url: ${env.RUNPOD_URL:+} url: ${env.RUNPOD_URL:=}
api_token: ${env.RUNPOD_API_TOKEN:+} api_token: ${env.RUNPOD_API_TOKEN:=}
``` ```

View file

@ -15,7 +15,7 @@ Together AI inference provider for open-source models and collaborative AI devel
```yaml ```yaml
url: https://api.together.xyz/v1 url: https://api.together.xyz/v1
api_key: ${env.TOGETHER_API_KEY:+} api_key: ${env.TOGETHER_API_KEY:=}
``` ```

View file

@ -17,8 +17,8 @@ IBM WatsonX inference provider for accessing AI models on IBM's WatsonX platform
```yaml ```yaml
url: ${env.WATSONX_BASE_URL:=https://us-south.ml.cloud.ibm.com} url: ${env.WATSONX_BASE_URL:=https://us-south.ml.cloud.ibm.com}
api_key: ${env.WATSONX_API_KEY:+} api_key: ${env.WATSONX_API_KEY:=}
project_id: ${env.WATSONX_PROJECT_ID:+} project_id: ${env.WATSONX_PROJECT_ID:=}
``` ```

View file

@ -19,7 +19,7 @@ NVIDIA's post-training provider for fine-tuning models on NVIDIA's platform.
## Sample Configuration ## Sample Configuration
```yaml ```yaml
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default} dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default}
project_id: ${env.NVIDIA_PROJECT_ID:=test-project} project_id: ${env.NVIDIA_PROJECT_ID:=test-project}
customizer_url: ${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test} customizer_url: ${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test}

View file

@ -13,7 +13,7 @@ Braintrust scoring provider for evaluation and scoring using the Braintrust plat
## Sample Configuration ## Sample Configuration
```yaml ```yaml
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
``` ```

View file

@ -14,7 +14,7 @@ Brave Search tool for web search capabilities with privacy-focused results.
## Sample Configuration ## Sample Configuration
```yaml ```yaml
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
``` ```

View file

@ -14,7 +14,7 @@ Tavily Search tool for AI-optimized web search with structured results.
## Sample Configuration ## Sample Configuration
```yaml ```yaml
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
``` ```

View file

@ -13,7 +13,7 @@ Wolfram Alpha tool for computational knowledge and mathematical calculations.
## Sample Configuration ## Sample Configuration
```yaml ```yaml
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
``` ```

View file

@ -166,20 +166,31 @@ def replace_env_vars(config: Any, path: str = "") -> Any:
env_value = os.environ.get(env_var) env_value = os.environ.get(env_var)
if operator == "=": # Default value syntax: ${env.FOO:=default} if operator == "=": # Default value syntax: ${env.FOO:=default}
if not env_value: # If the env is set like ${env.FOO:=default} then use the env value when set
if env_value:
value = env_value
else:
# If the env is not set, look for a default value
# value_expr returns empty string (not None) when not matched # value_expr returns empty string (not None) when not matched
# This means ${env.FOO:=} is an error # This means ${env.FOO:=} and it's accepted and returns empty string - just like bash
if value_expr == "": if value_expr == "":
raise EnvVarError(env_var, path) return ""
else: else:
value = value_expr value = value_expr
else:
value = env_value
elif operator == "+": # Conditional value syntax: ${env.FOO:+value_if_set} elif operator == "+": # Conditional value syntax: ${env.FOO:+value_if_set}
# If the env is set like ${env.FOO:+value_if_set} then use the value_if_set
if env_value: if env_value:
value = value_expr if value_expr:
value = value_expr
# This means ${env.FOO:+}
else:
# Just like bash, this doesn't care whether the env is set or not and applies
# the value, in this case the empty string
return ""
else: else:
# If env var is not set, return empty string for the conditional case # Just like bash, this doesn't care whether the env is set or not, since it's not set
# we return an empty string
value = "" value = ""
else: # No operator case: ${env.FOO} else: # No operator case: ${env.FOO}
if not env_value: if not env_value:

View file

@ -17,5 +17,5 @@ class BraintrustScoringConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, **kwargs) -> dict[str, Any]: def sample_run_config(cls, **kwargs) -> dict[str, Any]:
return { return {
"openai_api_key": "${env.OPENAI_API_KEY:+}", "openai_api_key": "${env.OPENAI_API_KEY:=}",
} }

View file

@ -54,7 +54,7 @@ class NvidiaDatasetIOConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, **kwargs) -> dict[str, Any]: def sample_run_config(cls, **kwargs) -> dict[str, Any]:
return { return {
"api_key": "${env.NVIDIA_API_KEY:+}", "api_key": "${env.NVIDIA_API_KEY:=}",
"dataset_namespace": "${env.NVIDIA_DATASET_NAMESPACE:=default}", "dataset_namespace": "${env.NVIDIA_DATASET_NAMESPACE:=default}",
"project_id": "${env.NVIDIA_PROJECT_ID:=test-project}", "project_id": "${env.NVIDIA_PROJECT_ID:=test-project}",
"datasets_url": "${env.NVIDIA_DATASETS_URL:=http://nemo.test}", "datasets_url": "${env.NVIDIA_DATASETS_URL:=http://nemo.test}",

View file

@ -53,9 +53,15 @@ class NVIDIAConfig(BaseModel):
) )
@classmethod @classmethod
def sample_run_config(cls, **kwargs) -> dict[str, Any]: def sample_run_config(
cls,
url: str = "${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com}",
api_key: str = "${env.NVIDIA_API_KEY:=}",
append_api_version: bool = "${env.NVIDIA_APPEND_API_VERSION:=True}",
**kwargs,
) -> dict[str, Any]:
return { return {
"url": "${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com}", "url": url,
"api_key": "${env.NVIDIA_API_KEY:+}", "api_key": api_key,
"append_api_version": "${env.NVIDIA_APPEND_API_VERSION:=True}", "append_api_version": append_api_version,
} }

View file

@ -25,6 +25,6 @@ class RunpodImplConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, **kwargs: Any) -> dict[str, Any]: def sample_run_config(cls, **kwargs: Any) -> dict[str, Any]:
return { return {
"url": "${env.RUNPOD_URL:+}", "url": "${env.RUNPOD_URL:=}",
"api_token": "${env.RUNPOD_API_TOKEN:+}", "api_token": "${env.RUNPOD_API_TOKEN:=}",
} }

View file

@ -26,5 +26,5 @@ class TogetherImplConfig(BaseModel):
def sample_run_config(cls, **kwargs) -> dict[str, Any]: def sample_run_config(cls, **kwargs) -> dict[str, Any]:
return { return {
"url": "https://api.together.xyz/v1", "url": "https://api.together.xyz/v1",
"api_key": "${env.TOGETHER_API_KEY:+}", "api_key": "${env.TOGETHER_API_KEY:=}",
} }

View file

@ -41,6 +41,6 @@ class WatsonXConfig(BaseModel):
def sample_run_config(cls, **kwargs) -> dict[str, Any]: def sample_run_config(cls, **kwargs) -> dict[str, Any]:
return { return {
"url": "${env.WATSONX_BASE_URL:=https://us-south.ml.cloud.ibm.com}", "url": "${env.WATSONX_BASE_URL:=https://us-south.ml.cloud.ibm.com}",
"api_key": "${env.WATSONX_API_KEY:+}", "api_key": "${env.WATSONX_API_KEY:=}",
"project_id": "${env.WATSONX_PROJECT_ID:+}", "project_id": "${env.WATSONX_PROJECT_ID:=}",
} }

View file

@ -55,7 +55,7 @@ class NvidiaPostTrainingConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, **kwargs) -> dict[str, Any]: def sample_run_config(cls, **kwargs) -> dict[str, Any]:
return { return {
"api_key": "${env.NVIDIA_API_KEY:+}", "api_key": "${env.NVIDIA_API_KEY:=}",
"dataset_namespace": "${env.NVIDIA_DATASET_NAMESPACE:=default}", "dataset_namespace": "${env.NVIDIA_DATASET_NAMESPACE:=default}",
"project_id": "${env.NVIDIA_PROJECT_ID:=test-project}", "project_id": "${env.NVIDIA_PROJECT_ID:=test-project}",
"customizer_url": "${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test}", "customizer_url": "${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test}",

View file

@ -22,6 +22,6 @@ class BraveSearchToolConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, __distro_dir__: str) -> dict[str, Any]: def sample_run_config(cls, __distro_dir__: str) -> dict[str, Any]:
return { return {
"api_key": "${env.BRAVE_SEARCH_API_KEY:+}", "api_key": "${env.BRAVE_SEARCH_API_KEY:=}",
"max_results": 3, "max_results": 3,
} }

View file

@ -22,6 +22,6 @@ class TavilySearchToolConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, __distro_dir__: str) -> dict[str, Any]: def sample_run_config(cls, __distro_dir__: str) -> dict[str, Any]:
return { return {
"api_key": "${env.TAVILY_SEARCH_API_KEY:+}", "api_key": "${env.TAVILY_SEARCH_API_KEY:=}",
"max_results": 3, "max_results": 3,
} }

View file

@ -17,5 +17,5 @@ class WolframAlphaToolConfig(BaseModel):
@classmethod @classmethod
def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> dict[str, Any]: def sample_run_config(cls, __distro_dir__: str, **kwargs: Any) -> dict[str, Any]:
return { return {
"api_key": "${env.WOLFRAM_ALPHA_API_KEY:+}", "api_key": "${env.WOLFRAM_ALPHA_API_KEY:=}",
} }

View file

@ -78,17 +78,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -77,7 +77,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
telemetry: telemetry:
- provider_id: meta-reference - provider_id: meta-reference
provider_type: inline::meta-reference provider_type: inline::meta-reference
@ -89,12 +89,12 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -81,17 +81,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -84,17 +84,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -80,17 +80,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -90,7 +90,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
files: files:
- provider_id: meta-reference-files - provider_id: meta-reference-files
provider_type: inline::localfs provider_type: inline::localfs
@ -103,17 +103,17 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
config: {} config: {}

View file

@ -85,7 +85,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
files: files:
- provider_id: meta-reference-files - provider_id: meta-reference-files
provider_type: inline::localfs provider_type: inline::localfs
@ -98,17 +98,17 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
config: {} config: {}

View file

@ -84,17 +84,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -89,17 +89,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -84,17 +84,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -89,17 +89,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -84,17 +84,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -41,7 +41,7 @@ def get_inference_providers() -> tuple[list[Provider], list[ModelInput]]:
( (
"llama-openai-compat", "llama-openai-compat",
LLLAMA_MODEL_ENTRIES, LLLAMA_MODEL_ENTRIES,
LlamaCompatConfig.sample_run_config(api_key="${env.LLAMA_API_KEY:+}"), LlamaCompatConfig.sample_run_config(api_key="${env.LLAMA_API_KEY:=}"),
), ),
] ]
inference_providers = [] inference_providers = []
@ -87,15 +87,15 @@ def get_distribution_template() -> DistributionTemplate:
Provider( Provider(
provider_id="${env.ENABLE_CHROMADB:+chromadb}", provider_id="${env.ENABLE_CHROMADB:+chromadb}",
provider_type="remote::chromadb", provider_type="remote::chromadb",
config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:+}"), config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:=}"),
), ),
Provider( Provider(
provider_id="${env.ENABLE_PGVECTOR:+pgvector}", provider_id="${env.ENABLE_PGVECTOR:+pgvector}",
provider_type="remote::pgvector", provider_type="remote::pgvector",
config=PGVectorVectorIOConfig.sample_run_config( config=PGVectorVectorIOConfig.sample_run_config(
db="${env.PGVECTOR_DB:+}", db="${env.PGVECTOR_DB:=}",
user="${env.PGVECTOR_USER:+}", user="${env.PGVECTOR_USER:=}",
password="${env.PGVECTOR_PASSWORD:+}", password="${env.PGVECTOR_PASSWORD:=}",
), ),
), ),
] ]

View file

@ -16,7 +16,7 @@ providers:
provider_type: remote::llama-openai-compat provider_type: remote::llama-openai-compat
config: config:
openai_compat_api_base: https://api.llama.com/compat/v1/ openai_compat_api_base: https://api.llama.com/compat/v1/
api_key: ${env.LLAMA_API_KEY:+} api_key: ${env.LLAMA_API_KEY:=}
- provider_id: sentence-transformers - provider_id: sentence-transformers
provider_type: inline::sentence-transformers provider_type: inline::sentence-transformers
config: {} config: {}
@ -28,15 +28,15 @@ providers:
- provider_id: ${env.ENABLE_CHROMADB:+chromadb} - provider_id: ${env.ENABLE_CHROMADB:+chromadb}
provider_type: remote::chromadb provider_type: remote::chromadb
config: config:
url: ${env.CHROMADB_URL:+} url: ${env.CHROMADB_URL:=}
- provider_id: ${env.ENABLE_PGVECTOR:+pgvector} - provider_id: ${env.ENABLE_PGVECTOR:+pgvector}
provider_type: remote::pgvector provider_type: remote::pgvector
config: config:
host: ${env.PGVECTOR_HOST:=localhost} host: ${env.PGVECTOR_HOST:=localhost}
port: ${env.PGVECTOR_PORT:=5432} port: ${env.PGVECTOR_PORT:=5432}
db: ${env.PGVECTOR_DB:+} db: ${env.PGVECTOR_DB:=}
user: ${env.PGVECTOR_USER:+} user: ${env.PGVECTOR_USER:=}
password: ${env.PGVECTOR_PASSWORD:+} password: ${env.PGVECTOR_PASSWORD:=}
safety: safety:
- provider_id: llama-guard - provider_id: llama-guard
provider_type: inline::llama-guard provider_type: inline::llama-guard
@ -93,17 +93,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -99,17 +99,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -89,17 +89,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -17,7 +17,7 @@ providers:
provider_type: remote::nvidia provider_type: remote::nvidia
config: config:
url: ${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com} url: ${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com}
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
append_api_version: ${env.NVIDIA_APPEND_API_VERSION:=True} append_api_version: ${env.NVIDIA_APPEND_API_VERSION:=True}
- provider_id: nvidia - provider_id: nvidia
provider_type: remote::nvidia provider_type: remote::nvidia
@ -65,7 +65,7 @@ providers:
- provider_id: nvidia - provider_id: nvidia
provider_type: remote::nvidia provider_type: remote::nvidia
config: config:
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default} dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default}
project_id: ${env.NVIDIA_PROJECT_ID:=test-project} project_id: ${env.NVIDIA_PROJECT_ID:=test-project}
customizer_url: ${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test} customizer_url: ${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test}
@ -80,7 +80,7 @@ providers:
- provider_id: nvidia - provider_id: nvidia
provider_type: remote::nvidia provider_type: remote::nvidia
config: config:
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default} dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default}
project_id: ${env.NVIDIA_PROJECT_ID:=test-project} project_id: ${env.NVIDIA_PROJECT_ID:=test-project}
datasets_url: ${env.NVIDIA_DATASETS_URL:=http://nemo.test} datasets_url: ${env.NVIDIA_DATASETS_URL:=http://nemo.test}

View file

@ -17,7 +17,7 @@ providers:
provider_type: remote::nvidia provider_type: remote::nvidia
config: config:
url: ${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com} url: ${env.NVIDIA_BASE_URL:=https://integrate.api.nvidia.com}
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
append_api_version: ${env.NVIDIA_APPEND_API_VERSION:=True} append_api_version: ${env.NVIDIA_APPEND_API_VERSION:=True}
vector_io: vector_io:
- provider_id: faiss - provider_id: faiss
@ -60,7 +60,7 @@ providers:
- provider_id: nvidia - provider_id: nvidia
provider_type: remote::nvidia provider_type: remote::nvidia
config: config:
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default} dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default}
project_id: ${env.NVIDIA_PROJECT_ID:=test-project} project_id: ${env.NVIDIA_PROJECT_ID:=test-project}
customizer_url: ${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test} customizer_url: ${env.NVIDIA_CUSTOMIZER_URL:=http://nemo.test}
@ -68,7 +68,7 @@ providers:
- provider_id: nvidia - provider_id: nvidia
provider_type: remote::nvidia provider_type: remote::nvidia
config: config:
api_key: ${env.NVIDIA_API_KEY:+} api_key: ${env.NVIDIA_API_KEY:=}
dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default} dataset_namespace: ${env.NVIDIA_DATASET_NAMESPACE:=default}
project_id: ${env.NVIDIA_PROJECT_ID:=test-project} project_id: ${env.NVIDIA_PROJECT_ID:=test-project}
datasets_url: ${env.NVIDIA_DATASETS_URL:=http://nemo.test} datasets_url: ${env.NVIDIA_DATASETS_URL:=http://nemo.test}

View file

@ -85,7 +85,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
files: files:
- provider_id: meta-reference-files - provider_id: meta-reference-files
provider_type: inline::localfs provider_type: inline::localfs
@ -105,12 +105,12 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -121,7 +121,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/registry.db

View file

@ -83,7 +83,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
files: files:
- provider_id: meta-reference-files - provider_id: meta-reference-files
provider_type: inline::localfs provider_type: inline::localfs
@ -103,12 +103,12 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -119,7 +119,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ollama}/registry.db

View file

@ -46,7 +46,7 @@ def get_inference_providers() -> tuple[list[Provider], dict[str, list[ProviderMo
model_type=ModelType.llm, model_type=ModelType.llm,
) )
], ],
OpenAIConfig.sample_run_config(api_key="${env.OPENAI_API_KEY:+}"), OpenAIConfig.sample_run_config(api_key="${env.OPENAI_API_KEY:=}"),
), ),
( (
"anthropic", "anthropic",
@ -56,7 +56,7 @@ def get_inference_providers() -> tuple[list[Provider], dict[str, list[ProviderMo
model_type=ModelType.llm, model_type=ModelType.llm,
) )
], ],
AnthropicConfig.sample_run_config(api_key="${env.ANTHROPIC_API_KEY:+}"), AnthropicConfig.sample_run_config(api_key="${env.ANTHROPIC_API_KEY:=}"),
), ),
( (
"gemini", "gemini",
@ -66,17 +66,17 @@ def get_inference_providers() -> tuple[list[Provider], dict[str, list[ProviderMo
model_type=ModelType.llm, model_type=ModelType.llm,
) )
], ],
GeminiConfig.sample_run_config(api_key="${env.GEMINI_API_KEY:+}"), GeminiConfig.sample_run_config(api_key="${env.GEMINI_API_KEY:=}"),
), ),
( (
"groq", "groq",
[], [],
GroqConfig.sample_run_config(api_key="${env.GROQ_API_KEY:+}"), GroqConfig.sample_run_config(api_key="${env.GROQ_API_KEY:=}"),
), ),
( (
"together", "together",
[], [],
TogetherImplConfig.sample_run_config(api_key="${env.TOGETHER_API_KEY:+}"), TogetherImplConfig.sample_run_config(api_key="${env.TOGETHER_API_KEY:=}"),
), ),
] ]
inference_providers = [] inference_providers = []
@ -122,15 +122,15 @@ def get_distribution_template() -> DistributionTemplate:
Provider( Provider(
provider_id="${env.ENABLE_CHROMADB:+chromadb}", provider_id="${env.ENABLE_CHROMADB:+chromadb}",
provider_type="remote::chromadb", provider_type="remote::chromadb",
config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:+}"), config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:=}"),
), ),
Provider( Provider(
provider_id="${env.ENABLE_PGVECTOR:+pgvector}", provider_id="${env.ENABLE_PGVECTOR:+pgvector}",
provider_type="remote::pgvector", provider_type="remote::pgvector",
config=PGVectorVectorIOConfig.sample_run_config( config=PGVectorVectorIOConfig.sample_run_config(
db="${env.PGVECTOR_DB:+}", db="${env.PGVECTOR_DB:=}",
user="${env.PGVECTOR_USER:+}", user="${env.PGVECTOR_USER:=}",
password="${env.PGVECTOR_PASSWORD:+}", password="${env.PGVECTOR_PASSWORD:=}",
), ),
), ),
] ]

View file

@ -15,25 +15,25 @@ providers:
- provider_id: openai - provider_id: openai
provider_type: remote::openai provider_type: remote::openai
config: config:
api_key: ${env.OPENAI_API_KEY:+} api_key: ${env.OPENAI_API_KEY:=}
- provider_id: anthropic - provider_id: anthropic
provider_type: remote::anthropic provider_type: remote::anthropic
config: config:
api_key: ${env.ANTHROPIC_API_KEY:+} api_key: ${env.ANTHROPIC_API_KEY:=}
- provider_id: gemini - provider_id: gemini
provider_type: remote::gemini provider_type: remote::gemini
config: config:
api_key: ${env.GEMINI_API_KEY:+} api_key: ${env.GEMINI_API_KEY:=}
- provider_id: groq - provider_id: groq
provider_type: remote::groq provider_type: remote::groq
config: config:
url: https://api.groq.com url: https://api.groq.com
api_key: ${env.GROQ_API_KEY:+} api_key: ${env.GROQ_API_KEY:=}
- provider_id: together - provider_id: together
provider_type: remote::together provider_type: remote::together
config: config:
url: https://api.together.xyz/v1 url: https://api.together.xyz/v1
api_key: ${env.TOGETHER_API_KEY:+} api_key: ${env.TOGETHER_API_KEY:=}
vector_io: vector_io:
- provider_id: sqlite-vec - provider_id: sqlite-vec
provider_type: inline::sqlite-vec provider_type: inline::sqlite-vec
@ -42,15 +42,15 @@ providers:
- provider_id: ${env.ENABLE_CHROMADB:+chromadb} - provider_id: ${env.ENABLE_CHROMADB:+chromadb}
provider_type: remote::chromadb provider_type: remote::chromadb
config: config:
url: ${env.CHROMADB_URL:+} url: ${env.CHROMADB_URL:=}
- provider_id: ${env.ENABLE_PGVECTOR:+pgvector} - provider_id: ${env.ENABLE_PGVECTOR:+pgvector}
provider_type: remote::pgvector provider_type: remote::pgvector
config: config:
host: ${env.PGVECTOR_HOST:=localhost} host: ${env.PGVECTOR_HOST:=localhost}
port: ${env.PGVECTOR_PORT:=5432} port: ${env.PGVECTOR_PORT:=5432}
db: ${env.PGVECTOR_DB:+} db: ${env.PGVECTOR_DB:=}
user: ${env.PGVECTOR_USER:+} user: ${env.PGVECTOR_USER:=}
password: ${env.PGVECTOR_PASSWORD:+} password: ${env.PGVECTOR_PASSWORD:=}
safety: safety:
- provider_id: llama-guard - provider_id: llama-guard
provider_type: inline::llama-guard provider_type: inline::llama-guard
@ -107,17 +107,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -89,22 +89,22 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
config: {} config: {}

View file

@ -84,22 +84,22 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
config: {} config: {}

View file

@ -52,7 +52,7 @@ def get_distribution_template() -> DistributionTemplate:
Provider( Provider(
provider_id="${env.ENABLE_CHROMADB:+chromadb}", provider_id="${env.ENABLE_CHROMADB:+chromadb}",
provider_type="remote::chromadb", provider_type="remote::chromadb",
config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:+}"), config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:=}"),
), ),
] ]
default_tool_groups = [ default_tool_groups = [
@ -114,7 +114,7 @@ def get_distribution_template() -> DistributionTemplate:
provider_id="meta-reference", provider_id="meta-reference",
provider_type="inline::meta-reference", provider_type="inline::meta-reference",
config=dict( config=dict(
service_name="${env.OTEL_SERVICE_NAME:+}", service_name="${env.OTEL_SERVICE_NAME:=}",
sinks="${env.TELEMETRY_SINKS:=console,otel_trace}", sinks="${env.TELEMETRY_SINKS:=console,otel_trace}",
otel_trace_endpoint="${env.OTEL_TRACE_ENDPOINT:=http://localhost:4318/v1/traces}", otel_trace_endpoint="${env.OTEL_TRACE_ENDPOINT:=http://localhost:4318/v1/traces}",
), ),

View file

@ -23,7 +23,7 @@ providers:
- provider_id: ${env.ENABLE_CHROMADB:+chromadb} - provider_id: ${env.ENABLE_CHROMADB:+chromadb}
provider_type: remote::chromadb provider_type: remote::chromadb
config: config:
url: ${env.CHROMADB_URL:+} url: ${env.CHROMADB_URL:=}
safety: safety:
- provider_id: llama-guard - provider_id: llama-guard
provider_type: inline::llama-guard provider_type: inline::llama-guard
@ -51,19 +51,19 @@ providers:
- provider_id: meta-reference - provider_id: meta-reference
provider_type: inline::meta-reference provider_type: inline::meta-reference
config: config:
service_name: ${env.OTEL_SERVICE_NAME:+} service_name: ${env.OTEL_SERVICE_NAME:=}
sinks: ${env.TELEMETRY_SINKS:=console,otel_trace} sinks: ${env.TELEMETRY_SINKS:=console,otel_trace}
otel_trace_endpoint: ${env.OTEL_TRACE_ENDPOINT:=http://localhost:4318/v1/traces} otel_trace_endpoint: ${env.OTEL_TRACE_ENDPOINT:=http://localhost:4318/v1/traces}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -86,7 +86,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
telemetry: telemetry:
- provider_id: meta-reference - provider_id: meta-reference
provider_type: inline::meta-reference provider_type: inline::meta-reference
@ -98,12 +98,12 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -114,7 +114,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/registry.db

View file

@ -79,7 +79,7 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
telemetry: telemetry:
- provider_id: meta-reference - provider_id: meta-reference
provider_type: inline::meta-reference provider_type: inline::meta-reference
@ -91,12 +91,12 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -107,7 +107,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/remote-vllm}/registry.db

View file

@ -28,15 +28,15 @@ providers:
- provider_id: ${env.ENABLE_CHROMADB:+chromadb} - provider_id: ${env.ENABLE_CHROMADB:+chromadb}
provider_type: remote::chromadb provider_type: remote::chromadb
config: config:
url: ${env.CHROMADB_URL:+} url: ${env.CHROMADB_URL:=}
- provider_id: ${env.ENABLE_PGVECTOR:+pgvector} - provider_id: ${env.ENABLE_PGVECTOR:+pgvector}
provider_type: remote::pgvector provider_type: remote::pgvector
config: config:
host: ${env.PGVECTOR_HOST:=localhost} host: ${env.PGVECTOR_HOST:=localhost}
port: ${env.PGVECTOR_PORT:=5432} port: ${env.PGVECTOR_PORT:=5432}
db: ${env.PGVECTOR_DB:+} db: ${env.PGVECTOR_DB:=}
user: ${env.PGVECTOR_USER:+} user: ${env.PGVECTOR_USER:=}
password: ${env.PGVECTOR_PASSWORD:+} password: ${env.PGVECTOR_PASSWORD:=}
safety: safety:
- provider_id: sambanova - provider_id: sambanova
provider_type: remote::sambanova provider_type: remote::sambanova
@ -65,12 +65,12 @@ providers:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -81,7 +81,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sambanova}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/sambanova}/registry.db

View file

@ -75,15 +75,15 @@ def get_distribution_template() -> DistributionTemplate:
Provider( Provider(
provider_id="${env.ENABLE_CHROMADB:+chromadb}", provider_id="${env.ENABLE_CHROMADB:+chromadb}",
provider_type="remote::chromadb", provider_type="remote::chromadb",
config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:+}"), config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:=}"),
), ),
Provider( Provider(
provider_id="${env.ENABLE_PGVECTOR:+pgvector}", provider_id="${env.ENABLE_PGVECTOR:+pgvector}",
provider_type="remote::pgvector", provider_type="remote::pgvector",
config=PGVectorVectorIOConfig.sample_run_config( config=PGVectorVectorIOConfig.sample_run_config(
db="${env.PGVECTOR_DB:+}", db="${env.PGVECTOR_DB:=}",
user="${env.PGVECTOR_USER:+}", user="${env.PGVECTOR_USER:=}",
password="${env.PGVECTOR_PASSWORD:+}", password="${env.PGVECTOR_PASSWORD:=}",
), ),
), ),
] ]

View file

@ -16,17 +16,17 @@ providers:
- provider_id: openai - provider_id: openai
provider_type: remote::openai provider_type: remote::openai
config: config:
api_key: ${env.OPENAI_API_KEY:+} api_key: ${env.OPENAI_API_KEY:=}
- provider_id: fireworks - provider_id: fireworks
provider_type: remote::fireworks provider_type: remote::fireworks
config: config:
url: https://api.fireworks.ai/inference/v1 url: https://api.fireworks.ai/inference/v1
api_key: ${env.FIREWORKS_API_KEY:+} api_key: ${env.FIREWORKS_API_KEY:=}
- provider_id: together - provider_id: together
provider_type: remote::together provider_type: remote::together
config: config:
url: https://api.together.xyz/v1 url: https://api.together.xyz/v1
api_key: ${env.TOGETHER_API_KEY:+} api_key: ${env.TOGETHER_API_KEY:=}
- provider_id: ollama - provider_id: ollama
provider_type: remote::ollama provider_type: remote::ollama
config: config:
@ -35,21 +35,21 @@ providers:
- provider_id: anthropic - provider_id: anthropic
provider_type: remote::anthropic provider_type: remote::anthropic
config: config:
api_key: ${env.ANTHROPIC_API_KEY:+} api_key: ${env.ANTHROPIC_API_KEY:=}
- provider_id: gemini - provider_id: gemini
provider_type: remote::gemini provider_type: remote::gemini
config: config:
api_key: ${env.GEMINI_API_KEY:+} api_key: ${env.GEMINI_API_KEY:=}
- provider_id: groq - provider_id: groq
provider_type: remote::groq provider_type: remote::groq
config: config:
url: https://api.groq.com url: https://api.groq.com
api_key: ${env.GROQ_API_KEY:+} api_key: ${env.GROQ_API_KEY:=}
- provider_id: sambanova - provider_id: sambanova
provider_type: remote::sambanova provider_type: remote::sambanova
config: config:
url: https://api.sambanova.ai/v1 url: https://api.sambanova.ai/v1
api_key: ${env.SAMBANOVA_API_KEY:+} api_key: ${env.SAMBANOVA_API_KEY:=}
- provider_id: vllm - provider_id: vllm
provider_type: remote::vllm provider_type: remote::vllm
config: config:
@ -83,15 +83,15 @@ providers:
- provider_id: ${env.ENABLE_CHROMADB:+chromadb} - provider_id: ${env.ENABLE_CHROMADB:+chromadb}
provider_type: remote::chromadb provider_type: remote::chromadb
config: config:
url: ${env.CHROMADB_URL:+} url: ${env.CHROMADB_URL:=}
- provider_id: ${env.ENABLE_PGVECTOR:+pgvector} - provider_id: ${env.ENABLE_PGVECTOR:+pgvector}
provider_type: remote::pgvector provider_type: remote::pgvector
config: config:
host: ${env.PGVECTOR_HOST:=localhost} host: ${env.PGVECTOR_HOST:=localhost}
port: ${env.PGVECTOR_PORT:=5432} port: ${env.PGVECTOR_PORT:=5432}
db: ${env.PGVECTOR_DB:+} db: ${env.PGVECTOR_DB:=}
user: ${env.PGVECTOR_USER:+} user: ${env.PGVECTOR_USER:=}
password: ${env.PGVECTOR_PASSWORD:+} password: ${env.PGVECTOR_PASSWORD:=}
files: files:
- provider_id: meta-reference-files - provider_id: meta-reference-files
provider_type: inline::localfs provider_type: inline::localfs
@ -156,17 +156,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -72,17 +72,17 @@ def get_inference_providers() -> tuple[list[Provider], dict[str, list[ProviderMo
( (
"openai", "openai",
OPENAI_MODEL_ENTRIES, OPENAI_MODEL_ENTRIES,
OpenAIConfig.sample_run_config(api_key="${env.OPENAI_API_KEY:+}"), OpenAIConfig.sample_run_config(api_key="${env.OPENAI_API_KEY:=}"),
), ),
( (
"fireworks", "fireworks",
FIREWORKS_MODEL_ENTRIES, FIREWORKS_MODEL_ENTRIES,
FireworksImplConfig.sample_run_config(api_key="${env.FIREWORKS_API_KEY:+}"), FireworksImplConfig.sample_run_config(api_key="${env.FIREWORKS_API_KEY:=}"),
), ),
( (
"together", "together",
TOGETHER_MODEL_ENTRIES, TOGETHER_MODEL_ENTRIES,
TogetherImplConfig.sample_run_config(api_key="${env.TOGETHER_API_KEY:+}"), TogetherImplConfig.sample_run_config(api_key="${env.TOGETHER_API_KEY:=}"),
), ),
( (
"ollama", "ollama",
@ -106,22 +106,22 @@ def get_inference_providers() -> tuple[list[Provider], dict[str, list[ProviderMo
( (
"anthropic", "anthropic",
ANTHROPIC_MODEL_ENTRIES, ANTHROPIC_MODEL_ENTRIES,
AnthropicConfig.sample_run_config(api_key="${env.ANTHROPIC_API_KEY:+}"), AnthropicConfig.sample_run_config(api_key="${env.ANTHROPIC_API_KEY:=}"),
), ),
( (
"gemini", "gemini",
GEMINI_MODEL_ENTRIES, GEMINI_MODEL_ENTRIES,
GeminiConfig.sample_run_config(api_key="${env.GEMINI_API_KEY:+}"), GeminiConfig.sample_run_config(api_key="${env.GEMINI_API_KEY:=}"),
), ),
( (
"groq", "groq",
GROQ_MODEL_ENTRIES, GROQ_MODEL_ENTRIES,
GroqConfig.sample_run_config(api_key="${env.GROQ_API_KEY:+}"), GroqConfig.sample_run_config(api_key="${env.GROQ_API_KEY:=}"),
), ),
( (
"sambanova", "sambanova",
SAMBANOVA_MODEL_ENTRIES, SAMBANOVA_MODEL_ENTRIES,
SambaNovaImplConfig.sample_run_config(api_key="${env.SAMBANOVA_API_KEY:+}"), SambaNovaImplConfig.sample_run_config(api_key="${env.SAMBANOVA_API_KEY:=}"),
), ),
( (
"vllm", "vllm",
@ -190,15 +190,15 @@ def get_distribution_template() -> DistributionTemplate:
Provider( Provider(
provider_id="${env.ENABLE_CHROMADB:+chromadb}", provider_id="${env.ENABLE_CHROMADB:+chromadb}",
provider_type="remote::chromadb", provider_type="remote::chromadb",
config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:+}"), config=ChromaVectorIOConfig.sample_run_config(url="${env.CHROMADB_URL:=}"),
), ),
Provider( Provider(
provider_id="${env.ENABLE_PGVECTOR:+pgvector}", provider_id="${env.ENABLE_PGVECTOR:+pgvector}",
provider_type="remote::pgvector", provider_type="remote::pgvector",
config=PGVectorVectorIOConfig.sample_run_config( config=PGVectorVectorIOConfig.sample_run_config(
db="${env.PGVECTOR_DB:+}", db="${env.PGVECTOR_DB:=}",
user="${env.PGVECTOR_USER:+}", user="${env.PGVECTOR_USER:=}",
password="${env.PGVECTOR_PASSWORD:+}", password="${env.PGVECTOR_PASSWORD:=}",
), ),
), ),
] ]

View file

@ -84,17 +84,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -83,17 +83,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -16,7 +16,7 @@ providers:
provider_type: remote::together provider_type: remote::together
config: config:
url: https://api.together.xyz/v1 url: https://api.together.xyz/v1
api_key: ${env.TOGETHER_API_KEY:+} api_key: ${env.TOGETHER_API_KEY:=}
- provider_id: sentence-transformers - provider_id: sentence-transformers
provider_type: inline::sentence-transformers provider_type: inline::sentence-transformers
config: {} config: {}
@ -89,17 +89,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -110,7 +110,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/registry.db

View file

@ -16,7 +16,7 @@ providers:
provider_type: remote::together provider_type: remote::together
config: config:
url: https://api.together.xyz/v1 url: https://api.together.xyz/v1
api_key: ${env.TOGETHER_API_KEY:+} api_key: ${env.TOGETHER_API_KEY:=}
- provider_id: sentence-transformers - provider_id: sentence-transformers
provider_type: inline::sentence-transformers provider_type: inline::sentence-transformers
config: {} config: {}
@ -84,17 +84,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime
@ -105,7 +105,7 @@ providers:
- provider_id: wolfram-alpha - provider_id: wolfram-alpha
provider_type: remote::wolfram-alpha provider_type: remote::wolfram-alpha
config: config:
api_key: ${env.WOLFRAM_ALPHA_API_KEY:+} api_key: ${env.WOLFRAM_ALPHA_API_KEY:=}
metadata_store: metadata_store:
type: sqlite type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/registry.db db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/together}/registry.db

View file

@ -88,17 +88,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -16,8 +16,8 @@ providers:
provider_type: remote::watsonx provider_type: remote::watsonx
config: config:
url: ${env.WATSONX_BASE_URL:=https://us-south.ml.cloud.ibm.com} url: ${env.WATSONX_BASE_URL:=https://us-south.ml.cloud.ibm.com}
api_key: ${env.WATSONX_API_KEY:+} api_key: ${env.WATSONX_API_KEY:=}
project_id: ${env.WATSONX_PROJECT_ID:+} project_id: ${env.WATSONX_PROJECT_ID:=}
- provider_id: sentence-transformers - provider_id: sentence-transformers
provider_type: inline::sentence-transformers provider_type: inline::sentence-transformers
config: {} config: {}
@ -85,17 +85,17 @@ providers:
- provider_id: braintrust - provider_id: braintrust
provider_type: inline::braintrust provider_type: inline::braintrust
config: config:
openai_api_key: ${env.OPENAI_API_KEY:+} openai_api_key: ${env.OPENAI_API_KEY:=}
tool_runtime: tool_runtime:
- provider_id: brave-search - provider_id: brave-search
provider_type: remote::brave-search provider_type: remote::brave-search
config: config:
api_key: ${env.BRAVE_SEARCH_API_KEY:+} api_key: ${env.BRAVE_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: tavily-search - provider_id: tavily-search
provider_type: remote::tavily-search provider_type: remote::tavily-search
config: config:
api_key: ${env.TAVILY_SEARCH_API_KEY:+} api_key: ${env.TAVILY_SEARCH_API_KEY:=}
max_results: 3 max_results: 3
- provider_id: rag-runtime - provider_id: rag-runtime
provider_type: inline::rag-runtime provider_type: inline::rag-runtime

View file

@ -34,6 +34,12 @@ class TestReplaceEnvVars(unittest.TestCase):
def test_default_value_when_empty(self): def test_default_value_when_empty(self):
self.assertEqual(replace_env_vars("${env.EMPTY_VAR:=default}"), "default") self.assertEqual(replace_env_vars("${env.EMPTY_VAR:=default}"), "default")
def test_none_value_when_empty(self):
self.assertEqual(replace_env_vars("${env.EMPTY_VAR:=}"), None)
def test_value_when_set(self):
self.assertEqual(replace_env_vars("${env.TEST_VAR:=}"), "test_value")
def test_empty_var_no_default(self): def test_empty_var_no_default(self):
self.assertEqual(replace_env_vars("${env.EMPTY_VAR_NO_DEFAULT:+}"), None) self.assertEqual(replace_env_vars("${env.EMPTY_VAR_NO_DEFAULT:+}"), None)