Skip to content

Commit e66103c

Browse files
fix: add missing files provider to NVIDIA distribution (#3479)
# What does this PR do? The rag-runtime tool requires files API as a dependency, but the NVIDIA distribution was missing the files provider configuration. Thus, when running: ``` llama stack build --distro nvidia --image-type venv ``` And then: ``` llama stack run {path_to_distribution_config} --image-type venv ``` It would raise an error: ``` RuntimeError: Failed to resolve 'tool_runtime' provider 'rag-runtime' of type 'inline::rag-runtime': required dependency 'files' is not available. Please add a 'files' provider to your configuration or check if the provider is properly configured. ``` This PR fixes the issue by adding missing files provider to NVIDIA distribution. ## Test Plan N/A
1 parent ea396a5 commit e66103c

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

docs/source/distributions/self_hosted_distro/nvidia.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The `llamastack/distribution-nvidia` distribution consists of the following prov
1111
| agents | `inline::meta-reference` |
1212
| datasetio | `inline::localfs`, `remote::nvidia` |
1313
| eval | `remote::nvidia` |
14+
| files | `inline::localfs` |
1415
| inference | `remote::nvidia` |
1516
| post_training | `remote::nvidia` |
1617
| safety | `remote::nvidia` |

llama_stack/distributions/nvidia/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ distribution_spec:
2323
- provider_type: inline::basic
2424
tool_runtime:
2525
- provider_type: inline::rag-runtime
26+
files:
27+
- provider_type: inline::localfs
2628
image_type: venv
2729
additional_pip_packages:
2830
- aiosqlite

llama_stack/distributions/nvidia/nvidia.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
from llama_stack.core.datatypes import BuildProvider, ModelInput, Provider, ShieldInput, ToolGroupInput
1010
from llama_stack.distributions.template import DistributionTemplate, RunConfigSettings, get_model_registry
11+
from llama_stack.providers.inline.files.localfs.config import LocalfsFilesImplConfig
1112
from llama_stack.providers.remote.datasetio.nvidia import NvidiaDatasetIOConfig
1213
from llama_stack.providers.remote.eval.nvidia import NVIDIAEvalConfig
1314
from llama_stack.providers.remote.inference.nvidia import NVIDIAConfig
1415
from llama_stack.providers.remote.inference.nvidia.models import MODEL_ENTRIES
1516
from llama_stack.providers.remote.safety.nvidia import NVIDIASafetyConfig
1617

1718

18-
def get_distribution_template() -> DistributionTemplate:
19+
def get_distribution_template(name: str = "nvidia") -> DistributionTemplate:
1920
providers = {
2021
"inference": [BuildProvider(provider_type="remote::nvidia")],
2122
"vector_io": [BuildProvider(provider_type="inline::faiss")],
@@ -30,6 +31,7 @@ def get_distribution_template() -> DistributionTemplate:
3031
],
3132
"scoring": [BuildProvider(provider_type="inline::basic")],
3233
"tool_runtime": [BuildProvider(provider_type="inline::rag-runtime")],
34+
"files": [BuildProvider(provider_type="inline::localfs")],
3335
}
3436

3537
inference_provider = Provider(
@@ -52,6 +54,11 @@ def get_distribution_template() -> DistributionTemplate:
5254
provider_type="remote::nvidia",
5355
config=NVIDIAEvalConfig.sample_run_config(),
5456
)
57+
files_provider = Provider(
58+
provider_id="meta-reference-files",
59+
provider_type="inline::localfs",
60+
config=LocalfsFilesImplConfig.sample_run_config(f"~/.llama/distributions/{name}"),
61+
)
5562
inference_model = ModelInput(
5663
model_id="${env.INFERENCE_MODEL}",
5764
provider_id="nvidia",
@@ -73,7 +80,7 @@ def get_distribution_template() -> DistributionTemplate:
7380

7481
default_models, _ = get_model_registry(available_models)
7582
return DistributionTemplate(
76-
name="nvidia",
83+
name=name,
7784
distro_type="self_hosted",
7885
description="Use NVIDIA NIM for running LLM inference, evaluation and safety",
7986
container_image=None,
@@ -86,6 +93,7 @@ def get_distribution_template() -> DistributionTemplate:
8693
"inference": [inference_provider],
8794
"datasetio": [datasetio_provider],
8895
"eval": [eval_provider],
96+
"files": [files_provider],
8997
},
9098
default_models=default_models,
9199
default_tool_groups=default_tool_groups,
@@ -97,6 +105,7 @@ def get_distribution_template() -> DistributionTemplate:
97105
safety_provider,
98106
],
99107
"eval": [eval_provider],
108+
"files": [files_provider],
100109
},
101110
default_models=[inference_model, safety_model],
102111
default_shields=[ShieldInput(shield_id="${env.SAFETY_MODEL}", provider_id="nvidia")],

llama_stack/distributions/nvidia/run-with-safety.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ apis:
44
- agents
55
- datasetio
66
- eval
7+
- files
78
- inference
89
- post_training
910
- safety
@@ -88,6 +89,14 @@ providers:
8889
tool_runtime:
8990
- provider_id: rag-runtime
9091
provider_type: inline::rag-runtime
92+
files:
93+
- provider_id: meta-reference-files
94+
provider_type: inline::localfs
95+
config:
96+
storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/nvidia/files}
97+
metadata_store:
98+
type: sqlite
99+
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/files_metadata.db
91100
metadata_store:
92101
type: sqlite
93102
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/registry.db

llama_stack/distributions/nvidia/run.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ apis:
44
- agents
55
- datasetio
66
- eval
7+
- files
78
- inference
89
- post_training
910
- safety
@@ -77,6 +78,14 @@ providers:
7778
tool_runtime:
7879
- provider_id: rag-runtime
7980
provider_type: inline::rag-runtime
81+
files:
82+
- provider_id: meta-reference-files
83+
provider_type: inline::localfs
84+
config:
85+
storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/nvidia/files}
86+
metadata_store:
87+
type: sqlite
88+
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/files_metadata.db
8089
metadata_store:
8190
type: sqlite
8291
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/nvidia}/registry.db

0 commit comments

Comments
 (0)