Skip to main content

paddler-client

Python client for the Paddler LLM load balancer.

Install

pip install paddler-client

Requires Python 3.11+. Built on httpx, websockets, and pydantic v2.

Quick start

WebSocket inference (multiplexed, request-id-keyed)

import asyncio

from paddler_client import ClientInference
from paddler_client.continue_from_conversation_history_params import (
    ContinueFromConversationHistoryParams,
)
from paddler_client.conversation_message import ConversationMessage


async def main() -> None:
    params = ContinueFromConversationHistoryParams(
        add_generation_prompt=True,
        conversation_history=[
            ConversationMessage(content="Say hello.", role="user"),
        ],
        enable_thinking=False,
        max_tokens=128,
    )

    async with ClientInference(url="http://localhost:8061") as client:
        stream = await client.continue_from_conversation_history(params)

        async for message in stream:
            if message.is_token:
                print(message.token, end="", flush=True)
            elif message.is_terminal:
                break


asyncio.run(main())

HTTP NDJSON streaming

async with ClientInference(url="http://localhost:8061") as client:
    async for message in client.post_continue_from_conversation_history(params):
        if message.is_token:
            print(message.token, end="", flush=True)
        elif message.is_terminal:
            break

ClientInference also provides continue_from_raw_prompt and generate_embedding_batch.

Management

from paddler_client import ClientManagement


async with ClientManagement(url="http://localhost:8062") as client:
    snapshot = await client.get_agents()

    for agent in snapshot.agents:
        print(agent.id, agent.slots_total)

    state = await client.get_balancer_desired_state()
    await client.put_balancer_desired_state(state)

    metrics = await client.get_metrics()

ClientManagement also provides agents_stream, get_buffered_requests, buffered_requests_stream, get_chat_template_override, and get_model_metadata.

Coverage

  • Transport: WebSocket (multiplexed), HTTP NDJSON, HTTP JSON, Server-Sent Events
  • Models: every Paddler wire-format type (validated via pydantic)
  • Fully typed (py.typed), async-first API
  • Specialized error types per failure mode

License

Apache-2.0

Metadata

Release files for paddler-client 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paddler-client 4.0.0
File Size Uploaded
paddler_client-4.0.0.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for paddler-client 4.0.0
File Interpreter ABI Platform
paddler_client-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.5 kB

Release files / paddler_client-4.0.0.tar.gz

Download URL paddler_client-4.0.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9aeb6001ce3adb4ea3a8dd94c29ac7cbb6ff22c93fac7870ee41daaf4f9e728d
BLAKE2b-256 checksum
How to use checksums
f770c0ea8ee26fc87022a4e7d2db4c8e1c75501ce219269f3dbc14d719afc2f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / paddler_client-4.0.0-py3-none-any.whl

Download URL paddler_client-4.0.0-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8c7e721f624f96a17315e77a9ab7d4942d1d19dc5f13df3339f34f1f46ae91c
BLAKE2b-256 checksum
How to use checksums
3e398bbc536b3ed53f165c76f5c6e31e4c123eae1f91413904d5bb64690da736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.2

2 release files

3.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page