Python client for the Alloy server
Project description
alloy-client
A lightweight Python client for the Alloy server.
Install
pip install alloy-client
For local development:
pip install -e .
Quick start
from alloy_client import AlloyClient
client = AlloyClient("http://127.0.0.1:8000")
# Images
result = client.image(model_id="qwen-image", prompt="a cinematic portrait")
with open("output.png", "wb") as f:
f.write(result["images"][0])
# Chat (non-streaming)
response = client.chat(
model="qwen3-medium",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response["message"]["content"])
# Audio (non-streaming)
audio = client.audio(
model_id="qwen3-tts-base",
text="Hello from Alloy",
)
print(audio["sample_rate"], len(audio["outputs"]))
Types
The client re-exports minimal Ollama-style types so you can annotate inputs without
pulling in the ollama dependency:
from alloy_client import Message, JsonSchemaValue
Notes
- Streaming is supported for
/imageonly. /chatand/audioare non-streaming for now.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alloyai_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: alloyai_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64cb60f77c6747e0c938f2996977bcea9e4caad9b17d28a4fb8a5652c8af95a
|
|
| MD5 |
091aa03e789f794966e52290e1d3d5cf
|
|
| BLAKE2b-256 |
edf6a8e3a17b9550a7f5fb24c81d42f550d3354d429227b6484102b6b66ad62a
|