chore: Stack server no longer depends on llama-stack-client (#4094)

This dependency has been bothering folks for a long time (cc @leseb). We
really needed it due to "library client" which is primarily used for our
tests and is not a part of the Stack server. Anyone who needs to use the
library client can certainly install `llama-stack-client` in their
environment to make that work.

Updated the notebook references to install `llama-stack-client`
additionally when setting things up.
This commit is contained in:
Ashwin Bharambe 2025-11-07 09:54:09 -08:00 committed by GitHub
parent 68c976a2d8
commit f49cb0b717
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 53 additions and 31 deletions

View file

@ -11,7 +11,7 @@ If you are planning to use an external service for Inference (even Ollama or TGI
This avoids the overhead of setting up a server.
```bash
# setup
uv pip install llama-stack
uv pip install llama-stack llama-stack-client
llama stack list-deps starter | xargs -L1 uv pip install
```

View file

@ -37,7 +37,7 @@
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"!pip install -U llama-stack\n",
"!pip install -U llama-stack llama-stack-client\n",
"llama stack list-deps fireworks | xargs -L1 uv pip install\n"
]
},

View file

@ -44,7 +44,7 @@
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"!pip install -U llama-stack"
"!pip install -U llama-stack llama-stack-client\n"
]
},
{

View file

@ -74,6 +74,7 @@
"source": [
"```bash\n",
"uv sync --extra dev\n",
"uv pip install -U llama-stack-client\n",
"uv pip install -e .\n",
"source .venv/bin/activate\n",
"```"

View file

@ -24,13 +24,13 @@ classifiers = [
"Topic :: Scientific/Engineering :: Information Analysis",
]
dependencies = [
"PyYAML>=6.0",
"aiohttp",
"fastapi>=0.115.0,<1.0", # server
"fire", # for MCP in LLS client
"httpx",
"jinja2>=3.1.6",
"jsonschema",
"llama-stack-client>=0.3.0",
"openai>=2.5.0",
"prompt-toolkit",
"python-dotenv",
@ -51,6 +51,11 @@ dependencies = [
"sqlalchemy[asyncio]>=2.0.41", # server - for conversations
]
[project.optional-dependencies]
client = [
"llama-stack-client>=0.3.0", # Optional for library-only usage
]
[dependency-groups]
dev = [
"pytest>=8.4",
@ -96,6 +101,7 @@ type_checking = [
"lm-format-enforcer",
"mcp",
"ollama",
"llama-stack-client>=0.3.0",
]
# These are the dependencies required for running unit tests.
unit = [

View file

@ -3,8 +3,3 @@
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from llama_stack.core.library_client import ( # noqa: F401
AsyncLlamaStackAsLibraryClient,
LlamaStackAsLibraryClient,
)

View file

@ -18,14 +18,21 @@ from typing import Any, TypeVar, Union, get_args, get_origin
import httpx
import yaml
from fastapi import Response as FastAPIResponse
from llama_stack_client import (
try:
from llama_stack_client import (
NOT_GIVEN,
APIResponse,
AsyncAPIResponse,
AsyncLlamaStackClient,
AsyncStream,
LlamaStackClient,
)
)
except ImportError as e:
raise ImportError(
"llama-stack-client is not installed. Please install it with `uv pip install llama-stack[client]`."
) from e
from pydantic import BaseModel, TypeAdapter
from rich.console import Console
from termcolor import cprint

View file

@ -20,6 +20,7 @@ This provider enables dataset management using NVIDIA's NeMo Customizer service.
Build the NVIDIA environment:
```bash
uv pip install llama-stack-client
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
```

View file

@ -18,6 +18,7 @@ This provider enables running inference using NVIDIA NIM.
Build the NVIDIA environment:
```bash
uv pip install llama-stack-client
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
```

View file

@ -22,6 +22,7 @@ This provider enables fine-tuning of LLMs using NVIDIA's NeMo Customizer service
Build the NVIDIA environment:
```bash
uv pip install llama-stack-client
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
```

View file

@ -19,6 +19,7 @@ This provider enables safety checks and guardrails for LLM interactions using NV
Build the NVIDIA environment:
```bash
uv pip install llama-stack-client
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
```

View file

@ -20,8 +20,8 @@ import yaml
from llama_stack_client import LlamaStackClient
from openai import OpenAI
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.datatypes import VectorStoresConfig
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from llama_stack.core.stack import run_config_from_adhoc_config_spec
from llama_stack.env import get_env_or_fail

View file

@ -16,7 +16,6 @@ from unittest.mock import AsyncMock, patch
import pytest
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.apis.datatypes import Api
from llama_stack.apis.inference.inference import (
OpenAIAssistantMessageParam,
@ -24,6 +23,7 @@ from llama_stack.apis.inference.inference import (
OpenAIChatCompletionUsage,
OpenAIChoice,
)
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from llama_stack.core.telemetry.telemetry import MetricEvent

View file

@ -13,7 +13,7 @@ import json
import pytest
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from llama_stack.models.llama.datatypes import ToolDefinition
from tests.common.mcp import make_mcp_server

View file

@ -7,7 +7,7 @@
import pytest
from llama_stack_client import LlamaStackClient
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
class TestInspect:

View file

@ -6,7 +6,7 @@
from llama_stack_client import LlamaStackClient
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
class TestProviders:

View file

@ -11,7 +11,7 @@ import pytest
import yaml
from openai import OpenAI
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
# --- Helper Functions ---

View file

@ -9,7 +9,7 @@ import time
import pytest
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from .helpers import new_vector_store, upload_file

View file

@ -12,8 +12,8 @@ import httpx
import openai
import pytest
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.datatypes import AuthenticationRequiredError
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from tests.common.mcp import dependency_tools, make_mcp_server
from .fixtures.test_cases import (

View file

@ -10,7 +10,7 @@ import pytest
from llama_stack_client.lib.agents.agent import Agent
from llama_stack_client.lib.agents.turn_events import StepCompleted, StepProgress, ToolCallIssuedDelta
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
AUTH_TOKEN = "test-token"

View file

@ -13,7 +13,7 @@ import json
import pytest
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from tests.common.mcp import make_mcp_server
AUTH_TOKEN = "test-token"

View file

@ -8,8 +8,8 @@ import re
import pytest
from llama_stack import LlamaStackAsLibraryClient
from llama_stack.apis.common.errors import ToolGroupNotFoundError
from llama_stack.core.library_client import LlamaStackAsLibraryClient
from tests.common.mcp import MCP_TOOLGROUP_ID, make_mcp_server

13
uv.lock generated
View file

@ -1945,7 +1945,6 @@ dependencies = [
{ name = "httpx" },
{ name = "jinja2" },
{ name = "jsonschema" },
{ name = "llama-stack-client" },
{ name = "openai" },
{ name = "opentelemetry-exporter-otlp-proto-http" },
{ name = "opentelemetry-sdk" },
@ -1955,6 +1954,7 @@ dependencies = [
{ name = "pyjwt", extra = ["crypto"] },
{ name = "python-dotenv" },
{ name = "python-multipart" },
{ name = "pyyaml" },
{ name = "rich" },
{ name = "sqlalchemy", extra = ["asyncio"] },
{ name = "starlette" },
@ -1963,6 +1963,11 @@ dependencies = [
{ name = "uvicorn" },
]
[package.optional-dependencies]
client = [
{ name = "llama-stack-client" },
]
[package.dev-dependencies]
benchmark = [
{ name = "locust" },
@ -2035,6 +2040,7 @@ type-checking = [
{ name = "datasets" },
{ name = "fairscale" },
{ name = "faiss-cpu" },
{ name = "llama-stack-client" },
{ name = "lm-format-enforcer" },
{ name = "mcp" },
{ name = "nest-asyncio" },
@ -2088,7 +2094,7 @@ requires-dist = [
{ name = "httpx" },
{ name = "jinja2", specifier = ">=3.1.6" },
{ name = "jsonschema" },
{ name = "llama-stack-client", specifier = ">=0.3.0" },
{ name = "llama-stack-client", marker = "extra == 'client'", specifier = ">=0.3.0" },
{ name = "openai", specifier = ">=2.5.0" },
{ name = "opentelemetry-exporter-otlp-proto-http", specifier = ">=1.30.0" },
{ name = "opentelemetry-sdk", specifier = ">=1.30.0" },
@ -2098,6 +2104,7 @@ requires-dist = [
{ name = "pyjwt", extras = ["crypto"], specifier = ">=2.10.0" },
{ name = "python-dotenv" },
{ name = "python-multipart", specifier = ">=0.0.20" },
{ name = "pyyaml", specifier = ">=6.0" },
{ name = "rich" },
{ name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.41" },
{ name = "starlette" },
@ -2105,6 +2112,7 @@ requires-dist = [
{ name = "tiktoken" },
{ name = "uvicorn", specifier = ">=0.34.0" },
]
provides-extras = ["client"]
[package.metadata.requires-dev]
benchmark = [{ name = "locust", specifier = ">=2.39.1" }]
@ -2175,6 +2183,7 @@ type-checking = [
{ name = "datasets" },
{ name = "fairscale" },
{ name = "faiss-cpu" },
{ name = "llama-stack-client", specifier = ">=0.3.0" },
{ name = "lm-format-enforcer" },
{ name = "mcp" },
{ name = "nest-asyncio" },