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.3.tar.gz
(5.8 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.3.tar.gz.
File metadata
- Download URL: alloyai_client-0.1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cf8ec185be60d57beb8d3b170f789967bbe5699859238417fc700f81e9e54bb
|
|
| MD5 |
8d1265a66db41176ae4c66912bc7b517
|
|
| BLAKE2b-256 |
d70aa20b624c579a9af4a9e3978d34f6567dc11d87ec18abda36f7950e51915f
|
File details
Details for the file alloyai_client-0.1.3-py3-none-any.whl.
File metadata
- Download URL: alloyai_client-0.1.3-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 |
722a56c120ea47508c98495a54c7c38a25b4df47b061383230d67792da8b750a
|
|
| MD5 |
3294cd39e79670b871a247e92f462efe
|
|
| BLAKE2b-256 |
d5a06af6ba5fb5183855b00ed2f51c4f9a5507df24eb833b64e8e02e8cc46e29
|