Skip to main content

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 /image only.
  • /chat and /audio are 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.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alloyai_client-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file alloyai_client-0.1.2.tar.gz.

File metadata

  • Download URL: alloyai_client-0.1.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for alloyai_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b96a057575da907f495502c783d61b2f4cfe1282f70cf03fce6d84c54021ef7f
MD5 de6ecd78de3d9be469c807f55ec0f5a0
BLAKE2b-256 2e61c44b8deee5af73940c70fb4b9e71b547fc686ca7d878186de6228bd54e39

See more details on using hashes here.

File details

Details for the file alloyai_client-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: alloyai_client-0.1.2-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

Hashes for alloyai_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f61e5af41719b9676f99cf484d8d5bdf1e79ba222ba5479172a2074e393d5ffa
MD5 5cfaa352d1650d065840897af90bac7e
BLAKE2b-256 0060b5eaccbaeee27c3ac4c78bff9398d141b75bba341732ad5fcbe2eb5e82d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page