Skip to content

Commit f49cb0b

Browse files
authored
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.
1 parent 68c976a commit f49cb0b

File tree

23 files changed

+53
-31
lines changed

23 files changed

+53
-31
lines changed

docs/docs/distributions/importing_as_library.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you are planning to use an external service for Inference (even Ollama or TGI
1111
This avoids the overhead of setting up a server.
1212
```bash
1313
# setup
14-
uv pip install llama-stack
14+
uv pip install llama-stack llama-stack-client
1515
llama stack list-deps starter | xargs -L1 uv pip install
1616
```
1717

docs/notebooks/Llama_Stack_Agent_Workflows.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"outputs": [],
3838
"source": [
3939
"# NBVAL_SKIP\n",
40-
"!pip install -U llama-stack\n",
40+
"!pip install -U llama-stack llama-stack-client\n",
4141
"llama stack list-deps fireworks | xargs -L1 uv pip install\n"
4242
]
4343
},

docs/notebooks/Llama_Stack_Benchmark_Evals.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"outputs": [],
4545
"source": [
4646
"# NBVAL_SKIP\n",
47-
"!pip install -U llama-stack"
47+
"!pip install -U llama-stack llama-stack-client\n"
4848
]
4949
},
5050
{

docs/notebooks/nvidia/beginner_e2e/Llama_Stack_NVIDIA_E2E_Flow.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"source": [
7575
"```bash\n",
7676
"uv sync --extra dev\n",
77+
"uv pip install -U llama-stack-client\n",
7778
"uv pip install -e .\n",
7879
"source .venv/bin/activate\n",
7980
"```"

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ classifiers = [
2424
"Topic :: Scientific/Engineering :: Information Analysis",
2525
]
2626
dependencies = [
27+
"PyYAML>=6.0",
2728
"aiohttp",
2829
"fastapi>=0.115.0,<1.0", # server
2930
"fire", # for MCP in LLS client
3031
"httpx",
3132
"jinja2>=3.1.6",
3233
"jsonschema",
33-
"llama-stack-client>=0.3.0",
3434
"openai>=2.5.0",
3535
"prompt-toolkit",
3636
"python-dotenv",
@@ -51,6 +51,11 @@ dependencies = [
5151
"sqlalchemy[asyncio]>=2.0.41", # server - for conversations
5252
]
5353

54+
[project.optional-dependencies]
55+
client = [
56+
"llama-stack-client>=0.3.0", # Optional for library-only usage
57+
]
58+
5459
[dependency-groups]
5560
dev = [
5661
"pytest>=8.4",
@@ -96,6 +101,7 @@ type_checking = [
96101
"lm-format-enforcer",
97102
"mcp",
98103
"ollama",
104+
"llama-stack-client>=0.3.0",
99105
]
100106
# These are the dependencies required for running unit tests.
101107
unit = [

src/llama_stack/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,3 @@
33
#
44
# This source code is licensed under the terms described in the LICENSE file in
55
# the root directory of this source tree.
6-
7-
from llama_stack.core.library_client import ( # noqa: F401
8-
AsyncLlamaStackAsLibraryClient,
9-
LlamaStackAsLibraryClient,
10-
)

src/llama_stack/core/library_client.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,21 @@
1818
import httpx
1919
import yaml
2020
from fastapi import Response as FastAPIResponse
21-
from llama_stack_client import (
22-
NOT_GIVEN,
23-
APIResponse,
24-
AsyncAPIResponse,
25-
AsyncLlamaStackClient,
26-
AsyncStream,
27-
LlamaStackClient,
28-
)
21+
22+
try:
23+
from llama_stack_client import (
24+
NOT_GIVEN,
25+
APIResponse,
26+
AsyncAPIResponse,
27+
AsyncLlamaStackClient,
28+
AsyncStream,
29+
LlamaStackClient,
30+
)
31+
except ImportError as e:
32+
raise ImportError(
33+
"llama-stack-client is not installed. Please install it with `uv pip install llama-stack[client]`."
34+
) from e
35+
2936
from pydantic import BaseModel, TypeAdapter
3037
from rich.console import Console
3138
from termcolor import cprint

src/llama_stack/providers/remote/datasetio/nvidia/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This provider enables dataset management using NVIDIA's NeMo Customizer service.
2020
Build the NVIDIA environment:
2121

2222
```bash
23+
uv pip install llama-stack-client
2324
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
2425
```
2526

src/llama_stack/providers/remote/inference/nvidia/NVIDIA.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This provider enables running inference using NVIDIA NIM.
1818
Build the NVIDIA environment:
1919

2020
```bash
21+
uv pip install llama-stack-client
2122
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
2223
```
2324

@@ -199,4 +200,4 @@ rerank_response = client.alpha.inference.rerank(
199200

200201
for i, result in enumerate(rerank_response):
201202
print(f"{i+1}. [Index: {result.index}, " f"Score: {(result.relevance_score):.3f}]")
202-
```
203+
```

src/llama_stack/providers/remote/post_training/nvidia/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This provider enables fine-tuning of LLMs using NVIDIA's NeMo Customizer service
2222
Build the NVIDIA environment:
2323

2424
```bash
25+
uv pip install llama-stack-client
2526
uv run llama stack list-deps nvidia | xargs -L1 uv pip install
2627
```
2728

0 commit comments

Comments
 (0)