Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.0-alpha.2"
".": "0.4.0-alpha.3"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 112
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-a9f69d4a5f5d9bf957497cac83fdad1f72c8a44614098447762c53883e8bd987.yml
openapi_spec_hash: 75de5bdff8e70591d6033b609fc24e5d
config_hash: 34558d5f6e265184d712d43e231eb693
configured_endpoints: 110
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-d95665c12a4155ef6ae80f76545152ac241d3ccab18148e4add99c0f528b9634.yml
openapi_spec_hash: b6073c3436942c3ea6cd6c23f71a1cc4
config_hash: 597b56196f814dd58c2cb2465aab9c9e
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.4.0-alpha.3 (2025-11-04)

Full Changelog: [v0.4.0-alpha.2...v0.4.0-alpha.3](https://github.com/llamastack/llama-stack-client-python/compare/v0.4.0-alpha.2...v0.4.0-alpha.3)

### Features

* **api:** remove openai/v1 endpoints ([e391af5](https://github.com/llamastack/llama-stack-client-python/commit/e391af5b47f10ca2c3fa7d36cacae1900af711b4))


### Bug Fixes

* update post_training CLI import path to use alpha subdirectory ([#293](https://github.com/llamastack/llama-stack-client-python/issues/293)) ([65cbe68](https://github.com/llamastack/llama-stack-client-python/commit/65cbe680ebeb30bf7e7cfebd1238f57bef792f5d))

## 0.4.0-alpha.2 (2025-11-03)

Full Changelog: [v0.4.0-alpha.1...v0.4.0-alpha.2](https://github.com/llamastack/llama-stack-client-python/compare/v0.4.0-alpha.1...v0.4.0-alpha.2)
Expand Down
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ The full API of this library can be found in [api.md](api.md). You may find basi
```python
from llama_stack_client import LlamaStackClient

client = LlamaStackClient(
base_url=f"http://{host}:{port}",
)
client = LlamaStackClient()

response = client.chat.completions.create(
messages=[{"role": "user", "content": "hello world, write me a 2 sentence poem about the moon"}],
model="meta-llama/Llama-3.2-3B-Instruct",
stream=False,
response = client.models.register(
model_id="model_id",
)
print(response)
print(response.identifier)
```

While you can provide an `api_key` keyword argument, we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) to add `LLAMA_STACK_CLIENT_API_KEY="My API Key"` to your `.env` file so that your API Key is not stored in source control.
Expand Down Expand Up @@ -97,18 +93,49 @@ client = AsyncLlamaStackClient(


async def main() -> None:
session = await client.agents.sessions.create(
agent_id="agent_id",
session_name="session_name",
response = await client.models.register(
model_id="model_id",
)
print(session.session_id)
print(response.identifier)


asyncio.run(main())
```

Functionality between the synchronous and asynchronous clients is otherwise identical.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install --pre llama_stack_client[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import asyncio
from llama_stack_client import DefaultAioHttpClient
from llama_stack_client import AsyncLlamaStackClient


async def main() -> None:
async with AsyncLlamaStackClient(
http_client=DefaultAioHttpClient(),
) as client:
response = await client.models.register(
model_id="model_id",
)
print(response.identifier)


asyncio.run(main())
```

## Streaming responses

We provide support for streaming responses using Server Side Events (SSE).
Expand Down
35 changes: 11 additions & 24 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ from llama_stack_client.types import (
Document,
InterleavedContent,
InterleavedContentItem,
Message,
ParamType,
QueryConfig,
QueryResult,
Expand Down Expand Up @@ -300,27 +299,27 @@ Methods:
Types:

```python
from llama_stack_client.types import ListModelsResponse, Model, ModelListResponse
from llama_stack_client.types import (
ListModelsResponse,
Model,
ModelRetrieveResponse,
ModelListResponse,
ModelRegisterResponse,
)
```

Methods:

- <code title="get /v1/models/{model_id}">client.models.<a href="./src/llama_stack_client/resources/models/models.py">retrieve</a>(model_id) -> <a href="./src/llama_stack_client/types/model.py">Model</a></code>
- <code title="get /v1/openai/v1/models">client.models.<a href="./src/llama_stack_client/resources/models/models.py">list</a>() -> <a href="./src/llama_stack_client/types/model_list_response.py">ModelListResponse</a></code>
- <code title="post /v1/models">client.models.<a href="./src/llama_stack_client/resources/models/models.py">register</a>(\*\*<a href="src/llama_stack_client/types/model_register_params.py">params</a>) -> <a href="./src/llama_stack_client/types/model.py">Model</a></code>
- <code title="get /v1/models/{model_id}">client.models.<a href="./src/llama_stack_client/resources/models/models.py">retrieve</a>(model_id) -> <a href="./src/llama_stack_client/types/model_retrieve_response.py">ModelRetrieveResponse</a></code>
- <code title="get /v1/models">client.models.<a href="./src/llama_stack_client/resources/models/models.py">list</a>() -> <a href="./src/llama_stack_client/types/model_list_response.py">ModelListResponse</a></code>
- <code title="post /v1/models">client.models.<a href="./src/llama_stack_client/resources/models/models.py">register</a>(\*\*<a href="src/llama_stack_client/types/model_register_params.py">params</a>) -> <a href="./src/llama_stack_client/types/model_register_response.py">ModelRegisterResponse</a></code>
- <code title="delete /v1/models/{model_id}">client.models.<a href="./src/llama_stack_client/resources/models/models.py">unregister</a>(model_id) -> None</code>

## OpenAI

Types:

```python
from llama_stack_client.types.models import OpenAIListResponse
```

Methods:

- <code title="get /v1/models">client.models.openai.<a href="./src/llama_stack_client/resources/models/openai.py">list</a>() -> <a href="./src/llama_stack_client/types/models/openai_list_response.py">OpenAIListResponse</a></code>
- <code title="get /v1/models">client.models.openai.<a href="./src/llama_stack_client/resources/models/openai.py">list</a>() -> <a href="./src/llama_stack_client/types/model_list_response.py">ModelListResponse</a></code>

# Providers

Expand Down Expand Up @@ -386,18 +385,6 @@ Methods:
- <code title="delete /v1/shields/{identifier}">client.shields.<a href="./src/llama_stack_client/resources/shields.py">delete</a>(identifier) -> None</code>
- <code title="post /v1/shields">client.shields.<a href="./src/llama_stack_client/resources/shields.py">register</a>(\*\*<a href="src/llama_stack_client/types/shield_register_params.py">params</a>) -> <a href="./src/llama_stack_client/types/shield.py">Shield</a></code>

# SyntheticDataGeneration

Types:

```python
from llama_stack_client.types import SyntheticDataGenerationResponse
```

Methods:

- <code title="post /v1/synthetic-data-generation/generate">client.synthetic_data_generation.<a href="./src/llama_stack_client/resources/synthetic_data_generation.py">generate</a>(\*\*<a href="src/llama_stack_client/types/synthetic_data_generation_generate_params.py">params</a>) -> <a href="./src/llama_stack_client/types/synthetic_data_generation_response.py">SyntheticDataGenerationResponse</a></code>

# Scoring

Types:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "llama_stack_client"
version = "0.4.0-alpha.2"
version = "0.4.0-alpha.3"
description = "The official Python library for the llama-stack-client API"
dynamic = ["readme"]
license = "MIT"
Expand Down
47 changes: 0 additions & 47 deletions src/llama_stack_client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
conversations,
vector_stores,
scoring_functions,
synthetic_data_generation,
)
from .resources.files import FilesResource, AsyncFilesResource
from .resources.tools import ToolsResource, AsyncToolsResource
Expand All @@ -84,10 +83,6 @@
from .resources.prompts.prompts import PromptsResource, AsyncPromptsResource
from .resources.scoring_functions import ScoringFunctionsResource, AsyncScoringFunctionsResource
from .resources.responses.responses import ResponsesResource, AsyncResponsesResource
from .resources.synthetic_data_generation import (
SyntheticDataGenerationResource,
AsyncSyntheticDataGenerationResource,
)
from .resources.tool_runtime.tool_runtime import ToolRuntimeResource, AsyncToolRuntimeResource
from .resources.conversations.conversations import ConversationsResource, AsyncConversationsResource
from .resources.vector_stores.vector_stores import VectorStoresResource, AsyncVectorStoresResource
Expand Down Expand Up @@ -269,12 +264,6 @@ def shields(self) -> ShieldsResource:

return ShieldsResource(self)

@cached_property
def synthetic_data_generation(self) -> SyntheticDataGenerationResource:
from .resources.synthetic_data_generation import SyntheticDataGenerationResource

return SyntheticDataGenerationResource(self)

@cached_property
def scoring(self) -> ScoringResource:
from .resources.scoring import ScoringResource
Expand Down Expand Up @@ -585,12 +574,6 @@ def shields(self) -> AsyncShieldsResource:

return AsyncShieldsResource(self)

@cached_property
def synthetic_data_generation(self) -> AsyncSyntheticDataGenerationResource:
from .resources.synthetic_data_generation import AsyncSyntheticDataGenerationResource

return AsyncSyntheticDataGenerationResource(self)

@cached_property
def scoring(self) -> AsyncScoringResource:
from .resources.scoring import AsyncScoringResource
Expand Down Expand Up @@ -850,12 +833,6 @@ def shields(self) -> shields.ShieldsResourceWithRawResponse:

return ShieldsResourceWithRawResponse(self._client.shields)

@cached_property
def synthetic_data_generation(self) -> synthetic_data_generation.SyntheticDataGenerationResourceWithRawResponse:
from .resources.synthetic_data_generation import SyntheticDataGenerationResourceWithRawResponse

return SyntheticDataGenerationResourceWithRawResponse(self._client.synthetic_data_generation)

@cached_property
def scoring(self) -> scoring.ScoringResourceWithRawResponse:
from .resources.scoring import ScoringResourceWithRawResponse
Expand Down Expand Up @@ -1001,14 +978,6 @@ def shields(self) -> shields.AsyncShieldsResourceWithRawResponse:

return AsyncShieldsResourceWithRawResponse(self._client.shields)

@cached_property
def synthetic_data_generation(
self,
) -> synthetic_data_generation.AsyncSyntheticDataGenerationResourceWithRawResponse:
from .resources.synthetic_data_generation import AsyncSyntheticDataGenerationResourceWithRawResponse

return AsyncSyntheticDataGenerationResourceWithRawResponse(self._client.synthetic_data_generation)

@cached_property
def scoring(self) -> scoring.AsyncScoringResourceWithRawResponse:
from .resources.scoring import AsyncScoringResourceWithRawResponse
Expand Down Expand Up @@ -1154,14 +1123,6 @@ def shields(self) -> shields.ShieldsResourceWithStreamingResponse:

return ShieldsResourceWithStreamingResponse(self._client.shields)

@cached_property
def synthetic_data_generation(
self,
) -> synthetic_data_generation.SyntheticDataGenerationResourceWithStreamingResponse:
from .resources.synthetic_data_generation import SyntheticDataGenerationResourceWithStreamingResponse

return SyntheticDataGenerationResourceWithStreamingResponse(self._client.synthetic_data_generation)

@cached_property
def scoring(self) -> scoring.ScoringResourceWithStreamingResponse:
from .resources.scoring import ScoringResourceWithStreamingResponse
Expand Down Expand Up @@ -1307,14 +1268,6 @@ def shields(self) -> shields.AsyncShieldsResourceWithStreamingResponse:

return AsyncShieldsResourceWithStreamingResponse(self._client.shields)

@cached_property
def synthetic_data_generation(
self,
) -> synthetic_data_generation.AsyncSyntheticDataGenerationResourceWithStreamingResponse:
from .resources.synthetic_data_generation import AsyncSyntheticDataGenerationResourceWithStreamingResponse

return AsyncSyntheticDataGenerationResourceWithStreamingResponse(self._client.synthetic_data_generation)

@cached_property
def scoring(self) -> scoring.AsyncScoringResourceWithStreamingResponse:
from .resources.scoring import AsyncScoringResourceWithStreamingResponse
Expand Down
14 changes: 0 additions & 14 deletions src/llama_stack_client/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,6 @@
ScoringFunctionsResourceWithStreamingResponse,
AsyncScoringFunctionsResourceWithStreamingResponse,
)
from .synthetic_data_generation import (
SyntheticDataGenerationResource,
AsyncSyntheticDataGenerationResource,
SyntheticDataGenerationResourceWithRawResponse,
AsyncSyntheticDataGenerationResourceWithRawResponse,
SyntheticDataGenerationResourceWithStreamingResponse,
AsyncSyntheticDataGenerationResourceWithStreamingResponse,
)

__all__ = [
"ToolgroupsResource",
Expand Down Expand Up @@ -308,12 +300,6 @@
"AsyncShieldsResourceWithRawResponse",
"ShieldsResourceWithStreamingResponse",
"AsyncShieldsResourceWithStreamingResponse",
"SyntheticDataGenerationResource",
"AsyncSyntheticDataGenerationResource",
"SyntheticDataGenerationResourceWithRawResponse",
"AsyncSyntheticDataGenerationResourceWithRawResponse",
"SyntheticDataGenerationResourceWithStreamingResponse",
"AsyncSyntheticDataGenerationResourceWithStreamingResponse",
"ScoringResource",
"AsyncScoringResource",
"ScoringResourceWithRawResponse",
Expand Down
Loading
Loading