Python client for the Alloy server
Project description
alloy-client
A lightweight Python client for the Alloy server.
Install
pip install alloyai-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 Distribution
alloyai_client-0.1.4.tar.gz
(5.9 kB
view details)
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.4.tar.gz.
File metadata
- Download URL: alloyai_client-0.1.4.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f28561742ed1bf80511f0e11eb37f35210adc650a22222328e24240efbbbdc5
|
|
| MD5 |
fda22e3d59f7911da356e17c5195c414
|
|
| BLAKE2b-256 |
ddd20a0bd0a73d5456481e5883eeae02b7c6e5f2cd1b965578154e119dd36d94
|
File details
Details for the file alloyai_client-0.1.4-py3-none-any.whl.
File metadata
- Download URL: alloyai_client-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
fae05bca04a9842856ccaca2b37d0de8d52453769803e936d4ab86dcdd276ed1
|
|
| MD5 |
bbf9be69e0ad1bdf5c63e0512265c99e
|
|
| BLAKE2b-256 |
6028505fabfd3a6f51522faf7b7e21a760bcfd445029e682806fef01c11bcfc9
|