| 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # This source code is licensed under the terms described in the LICENSE file in |
| 5 | # the root directory of this source tree. |
| 6 | |
| 7 | import argparse |
| 8 | |
| 9 | from llama_stack.cli.model.describe import ModelDescribe |
| 10 | from llama_stack.cli.model.download import ModelDownload |
| 11 | from llama_stack.cli.model.list import ModelList |
| 12 | from llama_stack.cli.model.prompt_format import ModelPromptFormat |
| 13 | |
| 14 | from llama_stack.cli.subcommand import Subcommand |
| 15 | |
| 16 | |
| 17 | class ModelParser(Subcommand): |
| 18 | """Llama cli for model interface apis""" |
| 19 | |
| 20 | def __init__(self, subparsers: argparse._SubParsersAction): |
| 21 | super().__init__() |
| 22 | self.parser = subparsers.add_parser( |
| 23 | "model", |
| 24 | prog="llama model", |
| 25 | description="Work with llama models", |
| 26 | ) |
| 27 | |
| 28 | subparsers = self.parser.add_subparsers(title="model_subcommands") |
| 29 | |
| 30 | # Add sub-commands |
| 31 | ModelDownload.create(subparsers) |
| 32 | ModelList.create(subparsers) |
| 33 | ModelPromptFormat.create(subparsers) |
| 34 | ModelDescribe.create(subparsers) |