mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-04 18:13:44 +00:00
llama distribution -> llama stack + containers (WIP)
This commit is contained in:
parent
45987996c4
commit
fd3b65b718
16 changed files with 204 additions and 80 deletions
|
|
@ -47,7 +47,7 @@ def get_dependencies(
|
|||
|
||||
return Dependencies(
|
||||
docker_image=provider.docker_image,
|
||||
pip_packages=pip_packages + SERVER_DEPENDENCIES
|
||||
pip_packages=pip_packages + SERVER_DEPENDENCIES,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -161,18 +161,29 @@ class ApiBuild(Subcommand):
|
|||
},
|
||||
**provider_deps,
|
||||
}
|
||||
with open(package_file, "w") as f:
|
||||
|
||||
# properly handle the case where package exists but has
|
||||
# inconsistent configuration for the providers. if possible,
|
||||
# we don't want to overwrite the existing configuration.
|
||||
if package_file.exists():
|
||||
cprint(
|
||||
f"Build `{package_name}` exists; will reconfigure",
|
||||
color="yellow",
|
||||
)
|
||||
c = PackageConfig(**yaml.safe_load(package_file.read_text()))
|
||||
else:
|
||||
c = PackageConfig(
|
||||
built_at=datetime.now(),
|
||||
package_name=package_name,
|
||||
docker_image=(
|
||||
package_name if args.type == BuildType.container.value else None
|
||||
),
|
||||
conda_env=(
|
||||
package_name if args.type == BuildType.conda_env.value else None
|
||||
),
|
||||
providers=stub_config,
|
||||
)
|
||||
|
||||
c.docker_image = (
|
||||
package_name if args.type == BuildType.container.value else None
|
||||
)
|
||||
c.conda_env = package_name if args.type == BuildType.conda_env.value else None
|
||||
|
||||
with open(package_file, "w") as f:
|
||||
to_write = json.loads(json.dumps(c.dict(), cls=EnumEncoder))
|
||||
f.write(yaml.dump(to_write, sort_keys=False))
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ def configure_llama_provider(config_file: Path) -> None:
|
|||
|
||||
try:
|
||||
existing_provider_config = config_type(**stub_config)
|
||||
except KeyError:
|
||||
except Exception:
|
||||
existing_provider_config = None
|
||||
|
||||
provider_config = prompt_for_config(
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class ApiStart(Subcommand):
|
|||
config.conda_env,
|
||||
]
|
||||
|
||||
run_args.extend(["--yaml_config", str(config_file), "--port", str(args.port)])
|
||||
run_args.extend([str(config_file), str(args.port)])
|
||||
if args.disable_ipv6:
|
||||
run_args.append("--disable-ipv6")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue