kikocis/llama-stack public
Changesets · Branches · Tags · Compare
| Changeset | 50b1e5278a6f4e26c1f4d9005b8eb07376609f37379572c117efc9cf2aba79e3 |
|---|---|
| Author | Xi Yan <xiyan@meta.com> · 2024-09-16 12:02 -07:00 |
| Committer | GitHub <noreply@github.com> · 2024-09-16 12:02 -07:00 |
| Parents | 63257be57107 |
1 file changed
modified docs/cli_reference.md +47 −15
| @@ -70,32 +70,54 @@ | ||
| 70 | 70 | |
| 71 | 71 | To download models, you can use the llama download command. |
| 72 | 72 | |
| 73 | +#### Downloading from [Meta](https://llama.meta.com/llama-downloads/) | |
| 74 | + | |
| 73 | 75 | Here is an example download command to get the 8B/70B Instruct model. You will need META_URL which can be obtained from [here](https://llama.meta.com/docs/getting_the_models/meta/) |
| 74 | -``` | |
| 75 | -llama download --source meta --model-id Meta-Llama3.1-8B-Instruct --meta-url <META_URL> | |
| 76 | -``` | |
| 77 | -``` | |
| 78 | -llama download --source meta --model-id Meta-Llama3.1-70B-Instruct --meta-url <META_URL> | |
| 79 | -``` | |
| 80 | 76 | |
| 81 | -You can download from HuggingFace using these commands | |
| 82 | -Set your environment variable HF_TOKEN or pass in --hf-token to the command to validate your access. | |
| 83 | -You can find your token at [here](https://huggingface.co/settings/tokens) | |
| 77 | +Download the required checkpoints using the following commands: | |
| 78 | +```bash | |
| 79 | +# download the 8B model, this can be run on a single GPU | |
| 80 | +llama download --source meta --model-id Meta-Llama3.1-8B-Instruct --meta-url META_URL | |
| 81 | + | |
| 82 | +# you can also get the 70B model, this will require 8 GPUs however | |
| 83 | +llama download --source meta --model-id Meta-Llama3.1-70B-Instruct --meta-url META_URL | |
| 84 | + | |
| 85 | +# llama-agents have safety enabled by default. For this, you will need | |
| 86 | +# safety models -- Llama-Guard and Prompt-Guard | |
| 87 | +llama download --source meta --model-id Prompt-Guard-86M --meta-url META_URL | |
| 88 | +llama download --source meta --model-id Llama-Guard-3-8B --meta-url META_URL | |
| 84 | 89 | ``` |
| 90 | + | |
| 91 | +#### Downloading from [Huggingface](https://huggingface.co/meta-llama) | |
| 92 | + | |
| 93 | +Essentially, the same commands above work, just replace `--source meta` with `--source huggingface`. | |
| 94 | + | |
| 95 | +```bash | |
| 85 | 96 | llama download --source huggingface --model-id Meta-Llama3.1-8B-Instruct --hf-token <HF_TOKEN> |
| 86 | -``` | |
| 87 | -``` | |
| 97 | + | |
| 88 | 98 | llama download --source huggingface --model-id Meta-Llama3.1-70B-Instruct --hf-token <HF_TOKEN> |
| 89 | -``` | |
| 90 | 99 | |
| 91 | -You can also download safety models from HF | |
| 92 | -``` | |
| 93 | 100 | llama download --source huggingface --model-id Llama-Guard-3-8B --ignore-patterns *original* |
| 101 | +llama download --source huggingface --model-id Prompt-Guard-86M --ignore-patterns *original* | |
| 94 | 102 | ``` |
| 103 | + | |
| 104 | +**Important:** Set your environment variable `HF_TOKEN` or pass in `--hf-token` to the command to validate your access. You can find your token at [https://huggingface.co/settings/tokens](https://huggingface.co/settings/tokens). | |
| 105 | + | |
| 106 | +> **Tip:** Default for `llama download` is to run with `--ignore-patterns *.safetensors` since we use the `.pth` files in the `original` folder. For Llama Guard and Prompt Guard, however, we need safetensors. Hence, please run with `--ignore-patterns original` so that safetensors are downloaded and `.pth` files are ignored. | |
| 107 | + | |
| 108 | +#### Downloading via Ollama | |
| 109 | + | |
| 110 | +If you're already using ollama, we also have a supported Llama Stack distribution `local-ollama` and you can continue to use ollama for managing model downloads. | |
| 111 | + | |
| 95 | 112 | ``` |
| 96 | -llama download --source huggingface --model-id Prompt-Guard-86M --ignore-patterns *original* | |
| 113 | +ollama pull llama3.1:8b-instruct-fp16 | |
| 114 | +ollama pull llama3.1:70b-instruct-fp16 | |
| 97 | 115 | ``` |
| 98 | 116 | |
| 117 | +> [!NOTE] | |
| 118 | +> Only the above two models are currently supported by Ollama. | |
| 119 | + | |
| 120 | + | |
| 99 | 121 | ## Step 2: Understand the models |
| 100 | 122 | The `llama model` command helps you explore the model’s interface. |
| 101 | 123 | |
| @@ -396,6 +418,16 @@ | ||
| 396 | 418 | Note that all configurations as well as models are stored in `~/.llama` |
| 397 | 419 | |
| 398 | 420 | |
| 421 | +#### Step 3.2.1 API Keys for Tools | |
| 422 | + | |
| 423 | +API key configuration for the Agentic System will be asked by the `llama stack build` script when you install a Llama Stack distribution. | |
| 424 | + | |
| 425 | +Tools that the model supports and which need API Keys -- | |
| 426 | +- Brave for web search (https://api.search.brave.com/register) | |
| 427 | +- Wolfram for math operations (https://developer.wolframalpha.com/) | |
| 428 | + | |
| 429 | +> **Tip** If you do not have API keys, you can still run the app without model having access to the tools. | |
| 430 | + | |
| 399 | 431 | ### Step 3.3. Run |
| 400 | 432 | Now, let's start the Llama Stack Distribution Server. You will need the YAML configuration file which was written out at the end by the `llama stack configure` step. |
| 401 | 433 |