mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 20:14:13 +00:00
add safety adapters, configuration handling, server + clients
This commit is contained in:
parent
9dafa6ad94
commit
fe582a739d
13 changed files with 286 additions and 67 deletions
|
@ -5,6 +5,7 @@
|
|||
# the root directory of this source tree.
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from llama_toolchain.cli.subcommand import Subcommand
|
||||
|
||||
|
@ -27,24 +28,23 @@ class DistributionList(Subcommand):
|
|||
|
||||
def _run_distribution_list_cmd(self, args: argparse.Namespace) -> None:
|
||||
from llama_toolchain.cli.table import print_table
|
||||
from llama_toolchain.distribution.distribution import distribution_dependencies
|
||||
from llama_toolchain.distribution.registry import available_distributions
|
||||
|
||||
# eventually, this should query a registry at llama.meta.com/llamastack/distributions
|
||||
headers = [
|
||||
"Name",
|
||||
"Adapters",
|
||||
"Description",
|
||||
"Dependencies",
|
||||
]
|
||||
|
||||
rows = []
|
||||
for dist in available_distributions():
|
||||
deps = distribution_dependencies(dist)
|
||||
adapters = {k.value: v.adapter_id for k, v in dist.adapters.items()}
|
||||
rows.append(
|
||||
[
|
||||
dist.name,
|
||||
json.dumps(adapters, indent=2),
|
||||
dist.description,
|
||||
", ".join(deps),
|
||||
]
|
||||
)
|
||||
print_table(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue