mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 04:50:39 +00:00
fix __distro_dir
This commit is contained in:
parent
c43ed8d0e6
commit
04e4e5ed5b
19 changed files with 22 additions and 22 deletions
|
@ -248,7 +248,7 @@ def _generate_run_config(
|
||||||
|
|
||||||
config_type = instantiate_class_type(provider_registry[Api(api)][provider_type].config_class)
|
config_type = instantiate_class_type(provider_registry[Api(api)][provider_type].config_class)
|
||||||
if hasattr(config_type, "sample_run_config"):
|
if hasattr(config_type, "sample_run_config"):
|
||||||
config = config_type.sample_run_config(__distro_dir__=f"distributions/{image_name}")
|
config = config_type.sample_run_config(__distro_dir__=f"~/.llama/distributions/{image_name}")
|
||||||
else:
|
else:
|
||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,9 @@ class TelemetryConfig(BaseModel):
|
||||||
return v
|
return v
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def sample_run_config(cls, __distro_dir__: str = "runtime", db_name: str = "trace_store.db") -> Dict[str, Any]:
|
def sample_run_config(cls, __distro_dir__: str, db_name: str = "trace_store.db") -> Dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
"service_name": "${env.OTEL_SERVICE_NAME:llama-stack}",
|
"service_name": "${env.OTEL_SERVICE_NAME:llama-stack}",
|
||||||
"sinks": "${env.TELEMETRY_SINKS:console,sqlite}",
|
"sinks": "${env.TELEMETRY_SINKS:console,sqlite}",
|
||||||
"sqlite_db_path": "${env.SQLITE_DB_PATH:~/.llama/" + __distro_dir__ + "/" + db_name + "}",
|
"sqlite_db_path": "${env.SQLITE_DB_PATH:" + __distro_dir__ + "/" + db_name + "}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,11 @@ class SqliteKVStoreConfig(CommonConfig):
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def sample_run_config(cls, __distro_dir__: str = "runtime", db_name: str = "kvstore.db"):
|
def sample_run_config(cls, __distro_dir__: str, db_name: str = "kvstore.db"):
|
||||||
return {
|
return {
|
||||||
"type": "sqlite",
|
"type": "sqlite",
|
||||||
"namespace": None,
|
"namespace": None,
|
||||||
"db_path": "${env.SQLITE_STORE_DIR:~/.llama/" + __distro_dir__ + "}/" + db_name,
|
"db_path": "${env.SQLITE_STORE_DIR:" + __distro_dir__ + "}/" + db_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
available_models = {
|
available_models = {
|
||||||
|
|
|
@ -62,7 +62,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
default_tool_groups = [
|
default_tool_groups = [
|
||||||
ToolGroupInput(
|
ToolGroupInput(
|
||||||
|
|
|
@ -48,7 +48,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="sqlite-vec",
|
provider_id="sqlite-vec",
|
||||||
provider_type="inline::sqlite-vec",
|
provider_type="inline::sqlite-vec",
|
||||||
config=SQLiteVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=SQLiteVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
embedding_provider = Provider(
|
embedding_provider = Provider(
|
||||||
provider_id="sentence-transformers",
|
provider_id="sentence-transformers",
|
||||||
|
|
|
@ -100,7 +100,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
Provider(
|
Provider(
|
||||||
provider_id="sqlite-vec",
|
provider_id="sqlite-vec",
|
||||||
provider_type="inline::sqlite-vec",
|
provider_type="inline::sqlite-vec",
|
||||||
config=SQLiteVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=SQLiteVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
),
|
),
|
||||||
Provider(
|
Provider(
|
||||||
provider_id="${env.ENABLE_CHROMADB+chromadb}",
|
provider_id="${env.ENABLE_CHROMADB+chromadb}",
|
||||||
|
|
|
@ -56,7 +56,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
available_models = {
|
available_models = {
|
||||||
|
|
|
@ -51,7 +51,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -52,7 +52,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -58,7 +58,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -67,7 +67,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -45,7 +45,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider_sqlite = Provider(
|
vector_io_provider_sqlite = Provider(
|
||||||
provider_id="sqlite-vec",
|
provider_id="sqlite-vec",
|
||||||
provider_type="inline::sqlite-vec",
|
provider_type="inline::sqlite-vec",
|
||||||
config=SQLiteVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=SQLiteVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -55,7 +55,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -46,7 +46,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(
|
config=FaissVectorIOConfig.sample_run_config(
|
||||||
__distro_dir__=f"distributions/{name}",
|
__distro_dir__=f"~/.llama/distributions/{name}",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Provider(
|
Provider(
|
||||||
|
|
|
@ -86,7 +86,7 @@ class RunConfigSettings(BaseModel):
|
||||||
|
|
||||||
config_class = instantiate_class_type(config_class)
|
config_class = instantiate_class_type(config_class)
|
||||||
if hasattr(config_class, "sample_run_config"):
|
if hasattr(config_class, "sample_run_config"):
|
||||||
config = config_class.sample_run_config(__distro_dir__=f"distributions/{name}")
|
config = config_class.sample_run_config(__distro_dir__=f"~/.llama/distributions/{name}")
|
||||||
else:
|
else:
|
||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class RunConfigSettings(BaseModel):
|
||||||
apis=apis,
|
apis=apis,
|
||||||
providers=provider_configs,
|
providers=provider_configs,
|
||||||
metadata_store=SqliteKVStoreConfig.sample_run_config(
|
metadata_store=SqliteKVStoreConfig.sample_run_config(
|
||||||
__distro_dir__=f"distributions/{name}",
|
__distro_dir__=f"~/.llama/distributions/{name}",
|
||||||
db_name="registry.db",
|
db_name="registry.db",
|
||||||
),
|
),
|
||||||
models=self.default_models or [],
|
models=self.default_models or [],
|
||||||
|
|
|
@ -55,7 +55,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_model = ModelInput(
|
inference_model = ModelInput(
|
||||||
|
|
|
@ -49,7 +49,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
embedding_provider = Provider(
|
embedding_provider = Provider(
|
||||||
provider_id="sentence-transformers",
|
provider_id="sentence-transformers",
|
||||||
|
|
|
@ -46,7 +46,7 @@ def get_distribution_template() -> DistributionTemplate:
|
||||||
vector_io_provider = Provider(
|
vector_io_provider = Provider(
|
||||||
provider_id="faiss",
|
provider_id="faiss",
|
||||||
provider_type="inline::faiss",
|
provider_type="inline::faiss",
|
||||||
config=FaissVectorIOConfig.sample_run_config(f"distributions/{name}"),
|
config=FaissVectorIOConfig.sample_run_config(f"~/.llama/distributions/{name}"),
|
||||||
)
|
)
|
||||||
embedding_provider = Provider(
|
embedding_provider = Provider(
|
||||||
provider_id="sentence-transformers",
|
provider_id="sentence-transformers",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue