docs: docusaurus setup (#3541)

# What does this PR do?

- Docusaurus server setup
- Deprecates Sphinx build pipeline
- Deprecates remaining references to Readthedocs
- MDX compile errors and broken links to be addressed in follow-up PRs

<!-- Provide a short summary of what this PR does and why. Link to relevant issues if applicable. -->

<!-- If resolving an issue, uncomment and update the line below -->

<!-- Closes #[issue-number] -->

## Test Plan

```
npm install
npm gen-api-docs all
npm run build
```

<!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* -->
This commit is contained in:
Alexey Rybak 2025-09-24 14:11:30 -07:00 committed by GitHub
parent 610526d6d7
commit aebd728c81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 23461 additions and 208 deletions

View file

@ -21,4 +21,3 @@ Llama Stack uses GitHub Actions for Continuous Integration (CI). Below is a tabl
| Test External API and Providers | [test-external.yml](test-external.yml) | Test the External API and Provider mechanisms |
| UI Tests | [ui-unit-tests.yml](ui-unit-tests.yml) | Run the UI test suite |
| Unit Tests | [unit-tests.yml](unit-tests.yml) | Run the unit test suite |
| Update ReadTheDocs | [update-readthedocs.yml](update-readthedocs.yml) | Update the Llama Stack ReadTheDocs site |

View file

@ -1,70 +0,0 @@
name: Update ReadTheDocs
run-name: Update the Llama Stack ReadTheDocs site
on:
workflow_dispatch:
inputs:
branch:
description: 'RTD version to update'
required: false
default: 'latest'
push:
branches:
- main
paths:
- 'docs/**'
- 'pyproject.toml'
- '.github/workflows/update-readthedocs.yml'
tags:
- '*'
pull_request:
branches:
- main
paths:
- 'docs/**'
- 'pyproject.toml'
- '.github/workflows/update-readthedocs.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
cancel-in-progress: true
jobs:
update-readthedocs:
runs-on: ubuntu-latest
env:
TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install dependencies
uses: ./.github/actions/setup-runner
- name: Build HTML
run: |
cd docs
uv run make html
- name: Trigger ReadTheDocs build
if: github.event_name != 'pull_request'
run: |
if [ -z "$TOKEN" ]; then
echo "READTHEDOCS_TOKEN is not set"
exit 1
fi
response=$(curl -X POST \
-H "Content-Type: application/json" \
-d "{
\"token\": \"$TOKEN\",
\"version\": \"$GITHUB_REF_NAME\"
}" \
https://readthedocs.org/api/v2/webhook/llama-stack/289768/)
echo "Response: $response"
if [ $(echo $response | jq -r '.build_triggered') != 'true' ]; then
echo "Failed to trigger ReadTheDocs build"
exit 1
fi

1
.gitignore vendored
View file

@ -18,7 +18,6 @@ Package.resolved
.venv/
.vscode
_build
docs/src
# Sample tool-calling datasets generated by NVIDIA notebooks
docs/notebooks/nvidia/tool_calling/sample_data/
pyrightconfig.json

View file

@ -1,25 +0,0 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs

View file

@ -187,14 +187,16 @@ Note that the provider "description" field will be used to generate the provider
### Building the Documentation
If you are making changes to the documentation at [https://llamastack.github.io/latest/](https://llamastack.github.io/latest/), you can use the following command to build the documentation and preview your changes. You will need [Sphinx](https://www.sphinx-doc.org/en/master/) and the readthedocs theme.
If you are making changes to the documentation at [https://llamastack.github.io/](https://llamastack.github.io/), you can use the following command to build the documentation and preview your changes.
```bash
# This rebuilds the documentation pages.
uv run --group docs make -C docs/ html
# This rebuilds the documentation pages and the OpenAPI spec.
npm install
npm run gen-api-docs all
npm run build
# This will start a local server (usually at http://127.0.0.1:8000) that automatically rebuilds and refreshes when you make changes to the documentation.
uv run --group docs sphinx-autobuild docs/source docs/build/html --write-all
# This will start a local server (usually at http://127.0.0.1:3000).
npm run serve
```
### Update API Documentation
@ -205,4 +207,4 @@ If you modify or add new API endpoints, update the API documentation accordingly
uv run ./docs/openapi_generator/run_openapi_generator.sh
```
The generated API documentation will be available in `docs/_static/`. Make sure to review the changes before committing.
The generated API schema will be available in `docs/static/`. Make sure to review the changes before committing.

View file

@ -1,20 +0,0 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View file

@ -1,14 +1,17 @@
# Llama Stack Documentation
Here's a collection of comprehensive guides, examples, and resources for building AI applications with Llama Stack. For the complete documentation, visit our [Github page](https://llamastack.github.io/latest/getting_started/index.html).
Here's a collection of comprehensive guides, examples, and resources for building AI applications with Llama Stack. For the complete documentation, visit our [Github page](https://llamastack.github.io/getting_started/quickstart).
## Render locally
From the llama-stack root directory, run the following command to render the docs locally:
From the llama-stack `docs/` directory, run the following commands to render the docs locally:
```bash
uv run --group docs sphinx-autobuild docs/source docs/build/html --write-all
npm install
npm run gen-api-docs all
npm run build
npm run serve
```
You can open up the docs in your browser at http://localhost:8000
You can open up the docs in your browser at http://localhost:3000
## Content

View file

@ -1,24 +0,0 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
import os
import time
def pytest_collection_modifyitems(items):
for item in items:
item.name = item.name.replace(' ', '_')
def pytest_runtest_teardown(item):
interval_seconds = os.getenv("LLAMA_STACK_TEST_INTERVAL_SECONDS")
if interval_seconds:
time.sleep(float(interval_seconds))
def pytest_configure(config):
config.option.tbstyle = "short"
config.option.disable_warnings = True

View file

@ -1,7 +0,0 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
sphinx-autobuild --write-all source build/html --watch source/

View file

@ -187,14 +187,16 @@ Note that the provider "description" field will be used to generate the provider
### Building the Documentation
If you are making changes to the documentation at [https://llamastack.github.io/latest/](https://llamastack.github.io/latest/), you can use the following command to build the documentation and preview your changes. You will need [Sphinx](https://www.sphinx-doc.org/en/master/) and the readthedocs theme.
If you are making changes to the documentation at [https://llamastack.github.io/](https://llamastack.github.io/), you can use the following command to build the documentation and preview your changes.
```bash
# This rebuilds the documentation pages.
uv run --group docs make -C docs/ html
# This rebuilds the documentation pages and the OpenAPI spec.
npm install
npm run gen-api-docs all
npm run build
# This will start a local server (usually at http://127.0.0.1:8000) that automatically rebuilds and refreshes when you make changes to the documentation.
uv run --group docs sphinx-autobuild docs/source docs/build/html --write-all
# This will start a local server (usually at http://127.0.0.1:3000).
npm run serve
```
### Update API Documentation
@ -205,7 +207,7 @@ If you modify or add new API endpoints, update the API documentation accordingly
uv run ./docs/openapi_generator/run_openapi_generator.sh
```
The generated API documentation will be available in `docs/_static/`. Make sure to review the changes before committing.
The generated API schema will be available in `docs/static/`. Make sure to review the changes before committing.
## Adding a New Provider

View file

@ -45,9 +45,9 @@ Llama Stack consists of a server (with multiple pluggable API providers) and Cli
## Quick Links
- Ready to build? Check out the [Getting Started Guide](https://llama-stack.readthedocs.io/en/latest/getting_started/index.html) to get started.
- Want to contribute? See the [Contributing Guide](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md).
- Explore [Example Applications](https://github.com/meta-llama/llama-stack-apps) built with Llama Stack.
- Ready to build? Check out the [Getting Started Guide](https://llama-stack.github.io/getting_started/quickstart) to get started.
- Want to contribute? See the [Contributing Guide](https://github.com/llamastack/llama-stack/blob/main/CONTRIBUTING.md).
- Explore [Example Applications](https://github.com/llamastack/llama-stack-apps) built with Llama Stack.
## Rich Ecosystem Support
@ -59,13 +59,13 @@ Llama Stack provides adapters for popular providers across all API categories:
- **Training & Evaluation**: HuggingFace, TorchTune, NVIDIA NEMO
:::info Provider Details
For complete provider compatibility and setup instructions, see our [Providers Documentation](https://llama-stack.readthedocs.io/en/latest/providers/index.html).
For complete provider compatibility and setup instructions, see our [Providers Documentation](https://llamastack.github.io/providers/).
:::
## Get Started Today
<div style={{display: 'flex', gap: '1rem', flexWrap: 'wrap', margin: '2rem 0'}}>
<a href="https://llama-stack.readthedocs.io/en/latest/getting_started/index.html"
<a href="https://llama-stack.github.io/getting_started/quickstart"
style={{
background: 'var(--ifm-color-primary)',
color: 'white',
@ -76,7 +76,7 @@ For complete provider compatibility and setup instructions, see our [Providers D
}}>
🚀 Quick Start Guide
</a>
<a href="https://github.com/meta-llama/llama-stack-apps"
<a href="https://github.com/llamastack/llama-stack-apps"
style={{
border: '2px solid var(--ifm-color-primary)',
color: 'var(--ifm-color-primary)',
@ -87,7 +87,7 @@ For complete provider compatibility and setup instructions, see our [Providers D
}}>
📚 Example Apps
</a>
<a href="https://github.com/meta-llama/llama-stack"
<a href="https://github.com/llamastack/llama-stack"
style={{
border: '2px solid #666',
color: '#666',

230
docs/docusaurus.config.ts Normal file
View file

@ -0,0 +1,230 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
import type * as Preset from "@docusaurus/preset-classic";
import type { Config } from "@docusaurus/types";
import type * as Plugin from "@docusaurus/types/src/plugin";
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
const config: Config = {
title: 'Llama Stack',
tagline: 'The open-source framework for building generative AI applications',
url: 'https://reluctantfuturist.github.io',
baseUrl: '/llama-stack/',
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
// GitHub pages deployment config.
organizationName: 'reluctantfuturist',
projectName: 'llama-stack',
trailingSlash: false,
presets: [
[
"classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.ts"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://github.com/meta-llama/llama-stack/tree/main/docs/',
docItemComponent: "@theme/ApiItem", // Derived from docusaurus-theme-openapi
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
} satisfies Preset.Options,
],
],
themeConfig: {
image: 'img/llama-stack.png',
navbar: {
title: 'Llama Stack',
logo: {
alt: 'Llama Stack Logo',
src: 'img/llama-stack-logo.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
},
{
type: 'docSidebar',
sidebarId: 'apiSidebar',
position: 'left',
label: 'API Reference',
},
{
href: 'https://github.com/llamastack/llama-stack',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Getting Started',
to: '/docs/getting_started/quickstart',
},
{
label: 'Concepts',
to: '/docs/concepts',
},
{
label: 'API Reference',
to: '/docs/api/llama-stack-specification',
},
],
},
{
title: 'Community',
items: [
{
label: 'Discord',
href: 'https://discord.gg/llama-stack',
},
{
label: 'GitHub Discussions',
href: 'https://github.com/llamastack/llama-stack/discussions',
},
{
label: 'Issues',
href: 'https://github.com/llamastack/llama-stack/issues',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/llamastack/llama-stack',
},
{
label: 'PyPI',
href: 'https://pypi.org/project/llama-stack/',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Meta Platforms, Inc. Built with Docusaurus.`,
},
prism: {
additionalLanguages: [
'ruby',
'csharp',
'php',
'java',
'powershell',
'json',
'bash',
'python',
'yaml',
],
},
docs: {
sidebar: {
hideable: true,
},
},
// Language tabs for API documentation
languageTabs: [
{
highlight: "python",
language: "python",
logoClass: "python",
},
{
highlight: "bash",
language: "curl",
logoClass: "curl",
},
{
highlight: "javascript",
language: "nodejs",
logoClass: "nodejs",
},
{
highlight: "java",
language: "java",
logoClass: "java",
},
],
} satisfies Preset.ThemeConfig,
plugins: [
[
"docusaurus-plugin-openapi-docs",
{
id: "openapi",
docsPluginId: "classic",
config: {
llamastack: {
specPath: "static/llama-stack-spec.yaml",
outputDir: "docs/api",
downloadUrl: "https://raw.githubusercontent.com/meta-llama/llama-stack/main/docs/static/llama-stack-spec.yaml",
sidebarOptions: {
groupPathsBy: "tag",
categoryLinkSource: "tag",
},
} satisfies OpenApiPlugin.Options,
} satisfies Plugin.PluginOptions,
},
],
],
themes: [
"docusaurus-theme-openapi-docs",
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
// Optimization for production
hashed: true,
// Language settings
language: ["en"],
// Content indexing settings
indexDocs: true,
indexBlog: false, // No blog in Llama Stack
indexPages: true,
// Route configuration
docsRouteBasePath: '/docs',
// Search behavior optimization for technical docs
searchResultLimits: 8,
searchResultContextMaxLength: 50,
explicitSearchResultPath: true,
// User experience enhancements
searchBarShortcut: true,
searchBarShortcutHint: true,
searchBarPosition: "right",
// Performance optimizations
ignoreFiles: [
"node_modules/**/*",
],
// Exclude OpenAPI generated docs from search to avoid duplicates
searchContextByPaths: [
"docs",
],
},
],
],
};
export default config;

View file

@ -15,7 +15,7 @@
"\n",
"[Llama Stack](https://github.com/meta-llama/llama-stack) defines and standardizes the set of core building blocks needed to bring generative AI applications to market. These building blocks are presented in the form of interoperable APIs with a broad set of Service Providers providing their implementations.\n",
"\n",
"Read more about the project here: https://llamastack.github.io/latest/getting_started/index.html\n",
"Read more about the project here: https://llamastack.github.io\n",
"\n",
"In this guide, we will showcase how you can build LLM-powered agentic applications using Llama Stack.\n",
"\n",

View file

@ -1,35 +0,0 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

View file

@ -14,7 +14,7 @@
"We will also showcase how to leverage existing Llama stack [inference APIs](https://github.com/meta-llama/llama-stack/blob/main/llama_stack/apis/inference/inference.py) (ollama as provider) to get the new model's output and the [eval APIs](https://github.com/meta-llama/llama-stack/blob/main/llama_stack/apis/eval/eval.py) to help you better measure the new model performance. We hope the flywheel of post-training -> eval -> inference can greatly empower agentic apps development.\n",
"\n",
"\n",
"- Read more about Llama Stack: https://llamastack.github.io/latest/index.html\n",
"- Read more about Llama Stack: https://llamastack.github.io/\n",
"- Read more about post training APIs definition: https://github.com/meta-llama/llama-stack/blob/main/llama_stack/apis/post_training/post_training.py\n",
"\n",
"\n",

22087
docs/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

44
docs/package.json Normal file
View file

@ -0,0 +1,44 @@
{
"name": "docusaurus-template-openapi-docs",
"version": "4.3.7",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"gen-api-docs": "docusaurus gen-api-docs",
"clean-api-docs": "docusaurus clean-api-docs",
"gen-api-docs:version": "docusaurus gen-api-docs:version",
"clean-api-docs:version": "docusaurus clean-api-docs:version"
},
"dependencies": {
"@docusaurus/core": "3.8.1",
"@docusaurus/preset-classic": "3.8.1",
"@easyops-cn/docusaurus-search-local": "^0.52.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-plugin-openapi-docs": "4.3.7",
"docusaurus-theme-openapi-docs": "4.3.7",
"prism-react-renderer": "^2.3.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

342
docs/sidebars.ts Normal file
View file

@ -0,0 +1,342 @@
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
const sidebars: SidebarsConfig = {
tutorialSidebar: [
'index',
{
type: 'category',
label: 'Getting Started',
collapsed: false,
items: [
'getting_started/quickstart',
'getting_started/detailed_tutorial',
'getting_started/libraries',
],
},
{
type: 'category',
label: 'Concepts',
collapsed: false,
items: [
'concepts/index',
'concepts/architecture',
{
type: 'category',
label: 'APIs',
collapsed: true,
items: [
'concepts/apis/index',
'concepts/apis/api_providers',
'concepts/apis/external',
'concepts/apis/api_leveling',
],
},
'concepts/distributions',
'concepts/resources',
],
},
{
type: 'category',
label: 'Distributions',
collapsed: false,
items: [
'distributions/index',
'distributions/list_of_distributions',
'distributions/building_distro',
'distributions/customizing_run_yaml',
'distributions/importing_as_library',
'distributions/configuration',
'distributions/starting_llama_stack_server',
{
type: 'category',
label: 'Self-Hosted Distributions',
collapsed: true,
items: [
'distributions/self_hosted_distro/starter',
'distributions/self_hosted_distro/dell',
'distributions/self_hosted_distro/dell-tgi',
'distributions/self_hosted_distro/meta-reference-gpu',
'distributions/self_hosted_distro/nvidia',
'distributions/self_hosted_distro/passthrough',
],
},
{
type: 'category',
label: 'Remote-Hosted Distributions',
collapsed: true,
items: [
'distributions/remote_hosted_distro/index',
'distributions/remote_hosted_distro/watsonx',
],
},
{
type: 'category',
label: 'On-Device Distributions',
collapsed: true,
items: [
'distributions/ondevice_distro/ios_sdk',
'distributions/ondevice_distro/android_sdk',
],
},
],
},
{
type: 'category',
label: 'Providers',
collapsed: false,
items: [
'providers/index',
{
type: 'category',
label: 'Inference',
collapsed: true,
items: [
'providers/inference/index',
'providers/inference/inline_meta-reference',
'providers/inference/inline_sentence-transformers',
'providers/inference/remote_anthropic',
'providers/inference/remote_azure',
'providers/inference/remote_bedrock',
'providers/inference/remote_cerebras',
'providers/inference/remote_databricks',
'providers/inference/remote_fireworks',
'providers/inference/remote_gemini',
'providers/inference/remote_groq',
'providers/inference/remote_hf_endpoint',
'providers/inference/remote_hf_serverless',
'providers/inference/remote_llama-openai-compat',
'providers/inference/remote_nvidia',
'providers/inference/remote_ollama',
'providers/inference/remote_openai',
'providers/inference/remote_passthrough',
'providers/inference/remote_runpod',
'providers/inference/remote_sambanova',
'providers/inference/remote_sambanova-openai-compat',
'providers/inference/remote_tgi',
'providers/inference/remote_together',
'providers/inference/remote_vertexai',
'providers/inference/remote_vllm',
'providers/inference/remote_watsonx'
],
},
{
type: 'category',
label: 'Safety',
collapsed: true,
items: [
'providers/safety/index',
'providers/safety/inline_code-scanner',
'providers/safety/inline_llama-guard',
'providers/safety/inline_prompt-guard',
'providers/safety/remote_bedrock',
'providers/safety/remote_nvidia',
'providers/safety/remote_sambanova'
],
},
{
type: 'category',
label: 'Vector IO',
collapsed: true,
items: [
'providers/vector_io/index',
'providers/vector_io/inline_chromadb',
'providers/vector_io/inline_faiss',
'providers/vector_io/inline_meta-reference',
'providers/vector_io/inline_milvus',
'providers/vector_io/inline_qdrant',
'providers/vector_io/inline_sqlite-vec',
'providers/vector_io/remote_chromadb',
'providers/vector_io/remote_milvus',
'providers/vector_io/remote_pgvector',
'providers/vector_io/remote_qdrant',
'providers/vector_io/remote_weaviate'
],
},
{
type: 'category',
label: 'Tool Runtime',
collapsed: true,
items: [
'providers/tool_runtime/index',
'providers/tool_runtime/inline_rag-runtime',
'providers/tool_runtime/remote_bing-search',
'providers/tool_runtime/remote_brave-search',
'providers/tool_runtime/remote_model-context-protocol',
'providers/tool_runtime/remote_tavily-search',
'providers/tool_runtime/remote_wolfram-alpha'
],
},
{
type: 'category',
label: 'Agents',
collapsed: true,
items: [
'providers/agents/index',
'providers/agents/inline_meta-reference'
],
},
{
type: 'category',
label: 'Post Training',
collapsed: true,
items: [
'providers/post_training/index',
'providers/post_training/inline_huggingface',
'providers/post_training/inline_huggingface-cpu',
'providers/post_training/inline_huggingface-gpu',
'providers/post_training/inline_torchtune',
'providers/post_training/inline_torchtune-cpu',
'providers/post_training/inline_torchtune-gpu',
'providers/post_training/remote_nvidia'
],
},
{
type: 'category',
label: 'DatasetIO',
collapsed: true,
items: [
'providers/datasetio/index',
'providers/datasetio/inline_localfs',
'providers/datasetio/remote_huggingface',
'providers/datasetio/remote_nvidia'
],
},
{
type: 'category',
label: 'Scoring',
collapsed: true,
items: [
'providers/scoring/index',
'providers/scoring/inline_basic',
'providers/scoring/inline_braintrust',
'providers/scoring/inline_llm-as-judge'
],
},
{
type: 'category',
label: 'Files',
collapsed: true,
items: [
'providers/files/index',
'providers/files/inline_localfs',
'providers/files/remote_s3'
],
},
{
type: 'category',
label: 'Eval',
collapsed: true,
items: [
'providers/eval/index',
'providers/eval/inline_meta-reference',
'providers/eval/remote_nvidia'
],
},
{
type: 'category',
label: 'Telemetry',
collapsed: true,
items: [
'providers/telemetry/index',
'providers/telemetry/inline_meta-reference'
],
},
{
type: 'category',
label: 'Batches',
collapsed: true,
items: [
'providers/batches/index',
'providers/batches/inline_reference'
],
},
{
type: 'category',
label: 'External Providers',
collapsed: true,
items: [
'providers/external/index',
'providers/external/external-providers-guide',
'providers/external/external-providers-list'
],
},
'providers/openai'
],
},
{
type: 'category',
label: 'Building Applications',
collapsed: false,
items: [
'building_applications/index',
'building_applications/rag',
'building_applications/agent',
'building_applications/agent_execution_loop',
'building_applications/responses_vs_agents',
'building_applications/tools',
'building_applications/evals',
'building_applications/telemetry',
'building_applications/safety',
'building_applications/playground',
],
},
{
type: 'category',
label: 'Advanced APIs',
collapsed: false,
items: [
'advanced_apis/post_training',
'advanced_apis/evaluation',
'advanced_apis/scoring',
],
},
{
type: 'category',
label: 'Deploying',
collapsed: false,
items: [
'deploying/index',
'deploying/kubernetes_deployment',
'deploying/aws_eks_deployment',
],
},
{
type: 'category',
label: 'Contributing',
collapsed: false,
items: [
'contributing/index',
'contributing/new_api_provider',
'contributing/new_vector_database',
'contributing/testing/record-replay',
],
},
{
type: 'category',
label: 'References',
collapsed: false,
items: [
'references/index',
'references/llama_cli_reference/index',
'references/llama_stack_client_cli_reference',
'references/python_sdk_reference/index',
'references/evals_reference/index',
],
},
],
// API Reference sidebar - use plugin-generated sidebar
apiSidebar: require('./docs/api/sidebar.ts').default,
};
export default sidebars;

View file

@ -0,0 +1,64 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
const FeatureList = [
{
title: 'Easy to Use',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
</>
),
},
{
title: 'Focus on What Matters',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
</>
),
},
{
title: 'Powered by React',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
</>
),
},
];
function Feature({Svg, title, description}) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
<div className="text--center padding-horiz--md">
<h3>{title}</h3>
<p>{description}</p>
</div>
</div>
);
}
export default function HomepageFeatures() {
return (
<section className={styles.features}>
<div className="container">
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
);
}

View file

@ -0,0 +1,11 @@
.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
}
.featureSvg {
height: 200px;
width: 200px;
}

191
docs/src/css/custom.css Normal file
View file

@ -0,0 +1,191 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
/* You can override the default Infima variables here. */
:root {
/* Llama Stack Original Theme - Based on llamastack.github.io */
--ifm-color-primary: #4a4a68;
--ifm-color-primary-dark: #3a3a52;
--ifm-color-primary-darker: #332735;
--ifm-color-primary-darkest: #2b2129;
--ifm-color-primary-light: #5a5a7e;
--ifm-color-primary-lighter: #6a6a94;
--ifm-color-primary-lightest: #8080aa;
/* Additional theme colors */
--ifm-color-secondary: #1b263c;
--ifm-color-info: #2980b9;
--ifm-color-success: #16a085;
--ifm-color-warning: #f39c12;
--ifm-color-danger: #e74c3c;
/* Background colors */
--ifm-background-color: #ffffff;
--ifm-background-surface-color: #f8f9fa;
/* Code and syntax highlighting */
--ifm-code-font-size: 95%;
--ifm-pre-background: #1b263c;
--ifm-pre-color: #e1e5e9;
--docusaurus-highlighted-code-line-bg: rgba(51, 39, 53, 0.1);
/* Link colors */
--ifm-link-color: var(--ifm-color-primary);
--ifm-link-hover-color: var(--ifm-color-primary-darker);
/* Navbar */
--ifm-navbar-background-color: rgba(255, 255, 255, 0.95);
--ifm-navbar-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
/* Hero section gradient - matching original theme */
--hero-gradient: linear-gradient(90deg, #332735 0%, #1b263c 100%);
/* OpenAPI method colors */
--openapi-code-blue: #2980b9;
--openapi-code-green: #16a085;
--openapi-code-orange: #f39c12;
--openapi-code-red: #e74c3c;
--openapi-code-purple: #332735;
}
/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
/* Dark theme primary colors - lighter versions of original theme */
--ifm-color-primary: #8080aa;
--ifm-color-primary-dark: #6a6a94;
--ifm-color-primary-darker: #5a5a7e;
--ifm-color-primary-darkest: #4a4a68;
--ifm-color-primary-light: #9090ba;
--ifm-color-primary-lighter: #a0a0ca;
--ifm-color-primary-lightest: #b0b0da;
/* Dark theme background colors */
--ifm-background-color: #1a1a1a;
--ifm-background-surface-color: #2a2a2a;
/* Dark theme navbar */
--ifm-navbar-background-color: rgba(26, 26, 26, 0.95);
/* Dark theme code highlighting */
--docusaurus-highlighted-code-line-bg: rgba(51, 39, 53, 0.3);
/* Dark theme text colors */
--ifm-font-color-base: #e1e5e9;
--ifm-font-color-secondary: #a0a6ac;
}
/* Sidebar Method labels */
.api-method>.menu__link {
align-items: center;
justify-content: start;
}
.api-method>.menu__link::before {
width: 50px;
height: 20px;
font-size: 12px;
line-height: 20px;
text-transform: uppercase;
font-weight: 600;
border-radius: 0.25rem;
border: 1px solid;
margin-right: var(--ifm-spacing-horizontal);
text-align: center;
flex-shrink: 0;
border-color: transparent;
color: white;
}
.get>.menu__link::before {
content: "get";
background-color: var(--ifm-color-primary);
}
.put>.menu__link::before {
content: "put";
background-color: var(--openapi-code-blue);
}
.post>.menu__link::before {
content: "post";
background-color: var(--openapi-code-green);
}
.delete>.menu__link::before {
content: "del";
background-color: var(--openapi-code-red);
}
.patch>.menu__link::before {
content: "patch";
background-color: var(--openapi-code-orange);
}
.footer--dark {
--ifm-footer-link-color: #ffffff;
--ifm-footer-title-color: #ffffff;
}
.footer--dark .footer__link-item {
color: #ffffff;
}
.footer--dark .footer__title {
color: #ffffff;
}
/* OpenAPI theme fixes for light mode readability */
/* Version badge fixes */
.openapi__version-badge,
.theme-doc-version-badge,
[class*="version-badge"],
[class*="versionBadge"] {
background-color: #ffffff !important;
color: #333333 !important;
border: 1px solid #d1d5db !important;
}
/* OpenAPI method badges in light mode */
.openapi__method-badge,
[class*="method-badge"] {
color: #ffffff !important;
}
/* Button fixes for light mode */
.openapi__button,
.theme-api-docs-demo-panel button,
[class*="api-docs"] button,
button[class*="button"],
.openapi-explorer__response-schema button,
.openapi-tabs__operation button {
color: #ffffff !important;
}
.openapi__button:hover,
.theme-api-docs-demo-panel button:hover,
[class*="api-docs"] button:hover,
button[class*="button"]:hover,
.openapi-explorer__response-schema button:hover,
.openapi-tabs__operation button:hover {
color: #ffffff !important;
}
/* Navigation buttons (Next/Previous) */
.pagination-nav__link,
.pagination-nav__label {
color: #333333 !important;
}
.pagination-nav__link--next,
.pagination-nav__link--prev {
background-color: #ffffff !important;
border: 1px solid #d1d5db !important;
}
.pagination-nav__link--next:hover,
.pagination-nav__link--prev:hover {
background-color: #f3f4f6 !important;
}

163
docs/src/pages/index.js Normal file
View file

@ -0,0 +1,163 @@
import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<div className={styles.heroContent}>
<h1 className={styles.heroTitle}>Build AI Applications with Llama Stack</h1>
<p className={styles.heroSubtitle}>
Unified APIs for Inference, RAG, Agents, Tools, Safety, and Telemetry
</p>
<div className={styles.buttons}>
<Link
className={clsx('button button--primary button--lg', styles.getStartedButton)}
to="/docs/getting_started/quickstart">
🚀 Get Started
</Link>
<Link
className={clsx('button button--primary button--lg', styles.apiButton)}
to="/docs/api/llama-stack-specification">
📚 API Reference
</Link>
</div>
</div>
</div>
</header>
);
}
function QuickStart() {
return (
<section className={styles.quickStart}>
<div className="container">
<div className="row">
<div className="col col--6">
<h2 className={styles.sectionTitle}>Quick Start</h2>
<p className={styles.sectionDescription}>
Get up and running with Llama Stack in just a few commands. Build your first RAG application locally.
</p>
<div className={styles.codeBlock}>
<pre><code>{`# Install uv and start Ollama
ollama run llama3.2:3b --keepalive 60m
# Run Llama Stack server
OLLAMA_URL=http://localhost:11434 \\
uv run --with llama-stack \\
llama stack build --distro starter \\
--image-type venv --run
# Try the Python SDK
from llama_stack_client import LlamaStackClient
client = LlamaStackClient(
base_url="http://localhost:8321"
)
response = client.inference.chat_completion(
model="Llama3.2-3B-Instruct",
messages=[{
"role": "user",
"content": "What is machine learning?"
}]
)`}</code></pre>
</div>
</div>
<div className="col col--6">
<h2 className={styles.sectionTitle}>Why Llama Stack?</h2>
<div className={styles.features}>
<div className={styles.feature}>
<div className={styles.featureIcon}>🔗</div>
<div>
<h4>Unified APIs</h4>
<p>One consistent interface for all your AI needs - inference, safety, agents, and more.</p>
</div>
</div>
<div className={styles.feature}>
<div className={styles.featureIcon}>🔄</div>
<div>
<h4>Provider Flexibility</h4>
<p>Swap between providers without code changes. Start local, deploy anywhere.</p>
</div>
</div>
<div className={styles.feature}>
<div className={styles.featureIcon}>🛡</div>
<div>
<h4>Production Ready</h4>
<p>Built-in safety, monitoring, and evaluation tools for enterprise applications.</p>
</div>
</div>
<div className={styles.feature}>
<div className={styles.featureIcon}>📱</div>
<div>
<h4>Multi-Platform</h4>
<p>SDKs for Python, Node.js, iOS, Android, and REST APIs for any language.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
);
}
function CommunityLinks() {
return (
<section className={styles.community}>
<div className="container">
<div className={styles.communityContent}>
<h2 className={styles.sectionTitle}>Join the Community</h2>
<p className={styles.sectionDescription}>
Connect with developers building the future of AI applications
</p>
<div className={styles.communityLinks}>
<a
href="https://github.com/llamastack/llama-stack"
className={clsx('button button--outline button--lg', styles.communityButton)}
target="_blank"
rel="noopener noreferrer">
<span className={styles.communityIcon}></span>
Star on GitHub
</a>
<a
href="https://discord.gg/llama-stack"
className={clsx('button button--outline button--lg', styles.communityButton)}
target="_blank"
rel="noopener noreferrer">
<span className={styles.communityIcon}>💬</span>
Join Discord
</a>
<Link
to="/docs/"
className={clsx('button button--outline button--lg', styles.communityButton)}>
<span className={styles.communityIcon}>📚</span>
Read Docs
</Link>
</div>
</div>
</div>
</section>
);
}
export default function Home() {
const {siteConfig} = useDocusaurusContext();
return (
<Layout
title="Build AI Applications"
description="The open-source framework for building generative AI applications with unified APIs for Inference, RAG, Agents, Tools, Safety, and Telemetry.">
<HomepageHeader />
<main>
<QuickStart />
<CommunityLinks />
</main>
</Layout>
);
}

View file

@ -0,0 +1,283 @@
/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/
.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
overflow: hidden;
background: var(--hero-gradient);
color: white;
display: flex;
align-items: center;
}
.heroBanner::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
pointer-events: none;
}
.heroContent {
max-width: 800px;
margin: 0 auto;
}
.heroLogo {
height: 48px;
width: auto;
margin-bottom: 1.5rem;
}
.heroTitle {
font-size: 2.8rem;
font-weight: 700;
margin-bottom: 1rem;
line-height: 1.2;
}
.heroSubtitle {
font-size: 1.1rem;
font-weight: 400;
margin-bottom: 2rem;
opacity: 0.9;
line-height: 1.5;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.heroBanner .getStartedButton {
background: white;
color: #332735;
border: 2px solid white;
font-weight: 600;
transition: all 0.3s ease;
}
.heroBanner .getStartedButton:hover {
background: rgba(255, 255, 255, 0.9);
color: #2b2129;
border-color: rgba(255, 255, 255, 0.9);
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.heroBanner .apiButton {
background: transparent;
color: white;
border: 2px solid white;
font-weight: 600;
transition: all 0.3s ease;
}
.heroBanner .apiButton:hover {
background: white;
border-color: white;
color: #332735;
transform: translateY(-2px);
}
/* Quick Start Section */
.quickStart {
padding: 4rem 0;
background: var(--ifm-background-color);
}
.sectionTitle {
font-size: 2rem;
font-weight: 600;
margin-bottom: 0.75rem;
color: var(--ifm-color-emphasis-800);
}
.sectionDescription {
font-size: 1rem;
color: var(--ifm-color-emphasis-600);
margin-bottom: 1.5rem;
line-height: 1.5;
}
.codeBlock {
background: var(--ifm-color-gray-900);
border-radius: 8px;
padding: 1.5rem;
margin-top: 1.5rem;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.codeBlock pre {
margin: 0;
padding: 0;
background: none;
border: none;
}
.codeBlock code {
color: var(--ifm-color-gray-100);
font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
font-size: 0.9rem;
line-height: 1.6;
}
/* Features */
.features {
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 1.5rem;
}
.feature {
display: flex;
align-items: flex-start;
gap: 1rem;
padding: 1rem;
border-radius: 8px;
background: var(--ifm-color-gray-50);
border: 1px solid var(--ifm-color-gray-200);
transition: all 0.2s ease;
}
.feature:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
border-color: var(--ifm-color-primary-lighter);
}
.featureIcon {
font-size: 2rem;
width: 3rem;
height: 3rem;
display: flex;
align-items: center;
justify-content: center;
background: var(--ifm-color-primary-lightest);
border-radius: 50%;
flex-shrink: 0;
}
.feature h4 {
margin: 0 0 0.5rem 0;
font-size: 1.1rem;
font-weight: 600;
color: var(--ifm-color-emphasis-800);
}
.feature p {
margin: 0;
color: var(--ifm-color-emphasis-600);
line-height: 1.5;
}
/* Community Section */
.community {
padding: 3rem 0;
background: var(--ifm-color-gray-50);
border-top: 1px solid var(--ifm-color-gray-200);
}
.communityContent {
text-align: center;
max-width: 600px;
margin: 0 auto;
}
.communityLinks {
display: flex;
justify-content: center;
gap: 1rem;
margin-top: 2rem;
}
.communityButton {
display: flex;
align-items: center;
gap: 0.5rem;
font-weight: 600;
transition: all 0.3s ease;
}
.communityButton:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.communityIcon {
font-size: 1.2rem;
}
/* Responsive Design */
@media screen and (max-width: 996px) {
.heroBanner {
padding: 3rem 2rem;
}
.heroTitle {
font-size: 2.2rem;
}
.heroSubtitle {
font-size: 1rem;
}
.buttons {
flex-direction: column;
gap: 1rem;
}
.quickStart {
padding: 3rem 0;
}
.sectionTitle {
font-size: 1.75rem;
}
.communityLinks {
flex-direction: column;
align-items: center;
}
.communityButton {
width: 200px;
justify-content: center;
}
}
@media screen and (max-width: 768px) {
.heroLogo {
height: 40px;
}
.heroTitle {
font-size: 1.8rem;
}
.codeBlock {
padding: 1rem;
}
.codeBlock code {
font-size: 0.8rem;
}
.feature {
padding: 0.75rem;
}
}

View file

@ -0,0 +1,7 @@
---
title: Markdown page example
---
# Markdown page example
You don't need React to write simple standalone pages.

7
docs/tsconfig.json Normal file
View file

@ -0,0 +1,7 @@
{
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
},
"exclude": [".docusaurus", "build"]
}