diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f64b8298b..3ce3de9ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -158,9 +158,9 @@ under the LICENSE file in the root directory of this source tree. Some tips about common tasks you work on while contributing to Llama Stack: -### Using `llama stack build` +### Installing dependencies of distributions -Building a stack image will use the production version of the `llama-stack` and `llama-stack-client` packages. If you are developing with a llama-stack repository checked out and need your code to be reflected in the stack image, set `LLAMA_STACK_DIR` and `LLAMA_STACK_CLIENT_DIR` to the appropriate checked out directories when running any of the `llama` CLI commands. +When installing dependencies for a distribution, you can use `llama stack list-deps` to view and install the required packages. Example: ```bash @@ -168,7 +168,12 @@ cd work/ git clone https://github.com/llamastack/llama-stack.git git clone https://github.com/llamastack/llama-stack-client-python.git cd llama-stack -LLAMA_STACK_DIR=$(pwd) LLAMA_STACK_CLIENT_DIR=../llama-stack-client-python llama stack build --distro <...> + +# Show dependencies for a distribution +llama stack list-deps + +# Install dependencies +llama stack list-deps | xargs -L1 uv pip install ``` ### Updating distribution configurations diff --git a/README.md b/README.md index 9cb9e32fc..7040eb5bc 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ MODEL="Llama-4-Scout-17B-16E-Instruct" # get meta url from llama.com llama model download --source meta --model-id $MODEL --meta-url +# install dependencies for the distribution +llama stack list-deps meta-reference-gpu | xargs -L1 uv pip install + # start a llama stack server -INFERENCE_MODEL=meta-llama/$MODEL llama stack build --run --template meta-reference-gpu +INFERENCE_MODEL=meta-llama/$MODEL llama stack run meta-reference-gpu # install client to interact with the server pip install llama-stack-client diff --git a/docs/docs/contributing/index.mdx b/docs/docs/contributing/index.mdx index 263900ecc..2051f6040 100644 --- a/docs/docs/contributing/index.mdx +++ b/docs/docs/contributing/index.mdx @@ -158,7 +158,7 @@ under the LICENSE file in the root directory of this source tree. Some tips about common tasks you work on while contributing to Llama Stack: -### Using `llama stack build` +### Installing dependencies of distributions Building a stack image will use the production version of the `llama-stack` and `llama-stack-client` packages. If you are developing with a llama-stack repository checked out and need your code to be reflected in the stack image, set `LLAMA_STACK_DIR` and `LLAMA_STACK_CLIENT_DIR` to the appropriate checked out directories when running any of the `llama` CLI commands. @@ -168,7 +168,7 @@ cd work/ git clone https://github.com/meta-llama/llama-stack.git git clone https://github.com/meta-llama/llama-stack-client-python.git cd llama-stack -LLAMA_STACK_DIR=$(pwd) LLAMA_STACK_CLIENT_DIR=../llama-stack-client-python llama stack build --distro <...> +llama stack build --distro <...> ``` ### Updating distribution configurations diff --git a/docs/docs/distributions/self_hosted_distro/starter.md b/docs/docs/distributions/self_hosted_distro/starter.md index faa82bcfa..78defa263 100644 --- a/docs/docs/distributions/self_hosted_distro/starter.md +++ b/docs/docs/distributions/self_hosted_distro/starter.md @@ -169,7 +169,11 @@ docker run \ Ensure you have configured the starter distribution using the environment variables explained above. ```bash -uv run --with llama-stack llama stack build --distro starter --image-type venv --run +# Install dependencies for the starter distribution +uv run --with llama-stack llama stack list-deps starter | xargs -L1 uv pip install + +# Run the server +uv run --with llama-stack llama stack run starter ``` ## Example Usage diff --git a/docs/docs/getting_started/detailed_tutorial.mdx b/docs/docs/getting_started/detailed_tutorial.mdx index e6c22224d..1b08e4f4e 100644 --- a/docs/docs/getting_started/detailed_tutorial.mdx +++ b/docs/docs/getting_started/detailed_tutorial.mdx @@ -58,15 +58,19 @@ Llama Stack is a server that exposes multiple APIs, you connect with it using th -You can use Python to build and run the Llama Stack server, which is useful for testing and development. +You can use Python to install dependencies and run the Llama Stack server, which is useful for testing and development. Llama Stack uses a [YAML configuration file](../distributions/configuration) to specify the stack setup, which defines the providers and their settings. The generated configuration serves as a starting point that you can [customize for your specific needs](../distributions/customizing_run_yaml). -Now let's build and run the Llama Stack config for Ollama. +Now let's install dependencies and run the Llama Stack config for Ollama. We use `starter` as template. By default all providers are disabled, this requires enable ollama by passing environment variables. ```bash -llama stack build --distro starter --image-type venv --run +# Install dependencies for the starter distribution +uv run --with llama-stack llama stack list-deps starter | xargs -L1 uv pip install + +# Run the server +llama stack run starter ``` diff --git a/docs/docs/getting_started/quickstart.mdx b/docs/docs/getting_started/quickstart.mdx index b885f3c66..2e47a771e 100644 --- a/docs/docs/getting_started/quickstart.mdx +++ b/docs/docs/getting_started/quickstart.mdx @@ -24,10 +24,13 @@ ollama run llama3.2:3b --keepalive 60m #### Step 2: Run the Llama Stack server -We will use `uv` to run the Llama Stack server. +We will use `uv` to install dependencies and run the Llama Stack server. ```bash -OLLAMA_URL=http://localhost:11434 \ - uv run --with llama-stack llama stack build --distro starter --image-type venv --run +# Install dependencies for the starter distribution +uv run --with llama-stack llama stack list-deps starter | xargs -L1 uv pip install + +# Run the server +OLLAMA_URL=http://localhost:11434 uv run --with llama-stack llama stack run starter ``` #### Step 3: Run the demo Now open up a new terminal and copy the following script into a file named `demo_script.py`. diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index 43c565f86..1a215b877 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -10061,4 +10061,4 @@ x-tagGroups: - PostTraining (Coming Soon) - Safety - Telemetry - - VectorIO \ No newline at end of file + - VectorIO