Update distribution_id -> distribution_type, provider_id -> provider_type

This commit is contained in:
Ashwin Bharambe 2024-09-07 08:42:28 -07:00
parent 3f090d1975
commit 70e682fbdf
18 changed files with 66 additions and 66 deletions

View file

@ -52,7 +52,7 @@ class StackBuild(Subcommand):
BuildType,
)
allowed_ids = [d.distribution_id for d in available_distribution_specs()]
allowed_ids = [d.distribution_type for d in available_distribution_specs()]
self.parser.add_argument(
"distribution",
type=str,
@ -101,7 +101,7 @@ class StackBuild(Subcommand):
api_inputs.append(
ApiInput(
api=api,
provider=provider_spec.provider_id,
provider=provider_spec.provider_type,
)
)
docker_image = None
@ -115,11 +115,11 @@ class StackBuild(Subcommand):
self.parser.error(f"Could not find distribution {args.distribution}")
return
for api, provider_id in dist.providers.items():
for api, provider_type in dist.providers.items():
api_inputs.append(
ApiInput(
api=api,
provider=provider_id,
provider=provider_type,
)
)
docker_image = dist.docker_image
@ -128,6 +128,6 @@ class StackBuild(Subcommand):
api_inputs,
build_type=BuildType(args.type),
name=args.name,
distribution_id=args.distribution,
distribution_type=args.distribution,
docker_image=docker_image,
)

View file

@ -36,7 +36,7 @@ class StackConfigure(Subcommand):
)
from llama_toolchain.core.package import BuildType
allowed_ids = [d.distribution_id for d in available_distribution_specs()]
allowed_ids = [d.distribution_type for d in available_distribution_specs()]
self.parser.add_argument(
"distribution",
type=str,
@ -84,7 +84,7 @@ def configure_llama_distribution(config_file: Path) -> None:
if config.providers:
cprint(
f"Configuration already exists for {config.distribution_id}. Will overwrite...",
f"Configuration already exists for {config.distribution_type}. Will overwrite...",
"yellow",
attrs=["bold"],
)

View file

@ -33,7 +33,7 @@ class StackListDistributions(Subcommand):
# eventually, this should query a registry at llama.meta.com/llamastack/distributions
headers = [
"Distribution ID",
"Distribution Type",
"Providers",
"Description",
]
@ -43,7 +43,7 @@ class StackListDistributions(Subcommand):
providers = {k.value: v for k, v in spec.providers.items()}
rows.append(
[
spec.distribution_id,
spec.distribution_type,
json.dumps(providers, indent=2),
spec.description,
]

View file

@ -41,7 +41,7 @@ class StackListProviders(Subcommand):
# eventually, this should query a registry at llama.meta.com/llamastack/distributions
headers = [
"Provider ID",
"Provider Type",
"PIP Package Dependencies",
]
@ -49,7 +49,7 @@ class StackListProviders(Subcommand):
for spec in providers_for_api.values():
rows.append(
[
spec.provider_id,
spec.provider_type,
",".join(spec.pip_packages),
]
)

View file

@ -80,7 +80,7 @@ class StackRun(Subcommand):
with open(config_file, "r") as f:
config = PackageConfig(**yaml.safe_load(f))
if not config.distribution_id:
if not config.distribution_type:
raise ValueError("Build config appears to be corrupt.")
if config.docker_image: