| 1 | # Llama Stack |
| 2 | |
| 3 | [](https://pypi.org/project/llama-stack/) |
| 4 | [](https://discord.gg/TZAAYNVtrU) |
| 5 | |
| 6 | This repository contains the Llama Stack API specifications as well as API Providers and Llama Stack Distributions. |
| 7 | |
| 8 | The Llama Stack defines and standardizes the building blocks needed to bring generative AI applications to market. These blocks span the entire development lifecycle: from model training and fine-tuning, through product evaluation, to building and running AI agents in production. Beyond definition, we are building providers for the Llama Stack APIs. These were developing open-source versions and partnering with providers, ensuring developers can assemble AI solutions using consistent, interlocking pieces across platforms. The ultimate goal is to accelerate innovation in the AI space. |
| 9 | |
| 10 | The Stack APIs are rapidly improving, but still very much work in progress and we invite feedback as well as direct contributions. |
| 11 | |
| 12 | |
| 13 | ## APIs |
| 14 | |
| 15 | The Llama Stack consists of the following set of APIs: |
| 16 | |
| 17 | - Inference |
| 18 | - Safety |
| 19 | - Memory |
| 20 | - Agentic System |
| 21 | - Evaluation |
| 22 | - Post Training |
| 23 | - Synthetic Data Generation |
| 24 | - Reward Scoring |
| 25 | |
| 26 | Each of the APIs themselves is a collection of REST endpoints. |
| 27 | |
| 28 | |
| 29 | ## API Providers |
| 30 | |
| 31 | A Provider is what makes the API real -- they provide the actual implementation backing the API. |
| 32 | |
| 33 | As an example, for Inference, we could have the implementation be backed by open source libraries like `[ torch | vLLM | TensorRT ]` as possible options. |
| 34 | |
| 35 | A provider can also be just a pointer to a remote REST service -- for example, cloud providers or dedicated inference providers could serve these APIs. |
| 36 | |
| 37 | |
| 38 | ## Llama Stack Distribution |
| 39 | |
| 40 | A Distribution is where APIs and Providers are assembled together to provide a consistent whole to the end application developer. You can mix-and-match providers -- some could be backed by local code and some could be remote. As a hobbyist, you can serve a small model locally, but can choose a cloud provider for a large model. Regardless, the higher level APIs your app needs to work with don't need to change at all. You can even imagine moving across the server / mobile-device boundary as well always using the same uniform set of APIs for developing Generative AI applications. |
| 41 | |
| 42 | ## Supported Llama Stack Implementations |
| 43 | ### API Providers |
| 44 | |
| 45 | |
| 46 | | **API Provider Builder** | **Environments** | **Agents** | **Inference** | **Memory** | **Safety** | **Telemetry** | |
| 47 | | :----: | :----: | :----: | :----: | :----: | :----: | :----: | |
| 48 | | Meta Reference | Single Node | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
| 49 | | Fireworks | Hosted | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | |
| 50 | | AWS Bedrock | Hosted | | :heavy_check_mark: | | :heavy_check_mark: | | |
| 51 | | Together | Hosted | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | |
| 52 | | Ollama | Single Node | | :heavy_check_mark: | | | |
| 53 | | TGI | Hosted and Single Node | | :heavy_check_mark: | | | |
| 54 | | Chroma | Single Node | | | :heavy_check_mark: | | | |
| 55 | | PG Vector | Single Node | | | :heavy_check_mark: | | | |
| 56 | | PyTorch ExecuTorch | On-device iOS | :heavy_check_mark: | :heavy_check_mark: | | | |
| 57 | |
| 58 | ### Distributions |
| 59 | | **Distribution Provider** | **Docker** | **Inference** | **Memory** | **Safety** | **Telemetry** | |
| 60 | | :----: | :----: | :----: | :----: | :----: | :----: | |
| 61 | | Meta Reference | [Local GPU](https://hub.docker.com/repository/docker/llamastack/llamastack-local-gpu/general), [Local CPU](https://hub.docker.com/repository/docker/llamastack/llamastack-local-cpu/general) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
| 62 | | Dell-TGI | [Local TGI + Chroma](https://hub.docker.com/repository/docker/llamastack/llamastack-local-tgi-chroma/general) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | |
| 63 | |
| 64 | |
| 65 | ## Installation |
| 66 | |
| 67 | You can install this repository as a [package](https://pypi.org/project/llama-stack/) with `pip install llama-stack` |
| 68 | |
| 69 | If you want to install from source: |
| 70 | |
| 71 | ```bash |
| 72 | mkdir -p ~/local |
| 73 | cd ~/local |
| 74 | git clone git@github.com:meta-llama/llama-stack.git |
| 75 | |
| 76 | conda create -n stack python=3.10 |
| 77 | conda activate stack |
| 78 | |
| 79 | cd llama-stack |
| 80 | $CONDA_PREFIX/bin/pip install -e . |
| 81 | ``` |
| 82 | |
| 83 | ## The Llama CLI |
| 84 | |
| 85 | The `llama` CLI makes it easy to work with the Llama Stack set of tools, including installing and running Distributions, downloading models, studying model prompt formats, etc. Please see the [CLI reference](docs/cli_reference.md) for details. |