Python client for the Herd daemon
Project description
Herd Python Client
This is the official Python client for the Herd daemon. It provides both synchronous and asynchronous interfaces for acquiring and managing worker sessions.
Installation
pip install herd-client
Quick Start (Async)
import asyncio
import httpx
from herd import AsyncClient
async def main():
client = AsyncClient("unix:///tmp/herd.sock")
async with client.acquire(worker_type="python-inference") as session:
print(f"Acquired worker: {session.id}")
async with httpx.AsyncClient() as http:
resp = await http.post(
f"{session.proxy_url}/generate",
headers={"X-Session-ID": session.id},
json={"prompt": "Hello world"}
)
print(resp.json())
if __name__ == "__main__":
asyncio.run(main())
Quick Start (Sync)
import requests
from herd import Client
client = Client("unix:///tmp/herd.sock")
with client.acquire(worker_type="python-inference") as session:
print(f"Acquired worker: {session.id}")
resp = requests.post(
f"{session.proxy_url}/generate",
headers={"X-Session-ID": session.id},
json={"prompt": "Hello world"}
)
print(resp.json())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 herd_client-0.1.0.tar.gz.
File metadata
- Download URL: herd_client-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de0d91b0534168e6a72d189a0d1db4174bad7936f9a673b8dd74cc03b8b702a2
|
|
| MD5 |
70101a27315179020539ba15e2b1c5a2
|
|
| BLAKE2b-256 |
2bf548ee640456007f94a75abd6d16fcfe3b85735f7df75bee110771419959ed
|
Provenance
The following attestation bundles were made for herd_client-0.1.0.tar.gz:
Publisher:
publish.yml on herd-core/herd-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
herd_client-0.1.0.tar.gz -
Subject digest:
de0d91b0534168e6a72d189a0d1db4174bad7936f9a673b8dd74cc03b8b702a2 - Sigstore transparency entry: 1182076349
- Sigstore integration time:
-
Permalink:
herd-core/herd-python-client@92fb15f2860e948474d109eb7c0299ebdb6e2a18 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/herd-core
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92fb15f2860e948474d109eb7c0299ebdb6e2a18 -
Trigger Event:
release
-
Statement type:
File details
Details for the file herd_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: herd_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b0de62999985547380b824606c096a5f084454fb7e4487d5d4302b057d1dc8e
|
|
| MD5 |
4268f5d362abc68e4f0940122f8840fe
|
|
| BLAKE2b-256 |
91272248dd6ac0d14e3e72b7371e959c49ab7453a2f9f996545212432b70b790
|
Provenance
The following attestation bundles were made for herd_client-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on herd-core/herd-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
herd_client-0.1.0-py3-none-any.whl -
Subject digest:
9b0de62999985547380b824606c096a5f084454fb7e4487d5d4302b057d1dc8e - Sigstore transparency entry: 1182076360
- Sigstore integration time:
-
Permalink:
herd-core/herd-python-client@92fb15f2860e948474d109eb7c0299ebdb6e2a18 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/herd-core
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@92fb15f2860e948474d109eb7c0299ebdb6e2a18 -
Trigger Event:
release
-
Statement type: