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.1.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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alloyai_client-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 07f94ed8baa3bed087b8063f3181705a6f077685868a98faa1e163d8b45bd497
MD5 acb78ccabdde8232dcb0d3923c3936a3
BLAKE2b-256 6d1d0d184ed63deb36ee89500c1a873411f68b6d11b6b77557bf37c4d1d03ae1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alloyai_client-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cea580dac350f945f26cb90fd538d07677e4fa1590e9b7d8590ae8994e6cb719
MD5 4b9fa3b4d8341495d1c62b93005fcbe7
BLAKE2b-256 a3f2357d8ba19cc8a9c8688f6631a50f5befbe493127b9217523f7973b68d4f9

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