Metadata-Version: 2.4
Name: herd-client
Version: 0.1.0
Summary: Python client for the Herd daemon
Author-email: Herd Team <hackstrix99@gmail.com>
Project-URL: Homepage, https://docs.herdcore.io
Project-URL: Bug Tracker, https://github.com/herd-core/herd-python-client/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: grpcio>=1.50.0
Requires-Dist: protobuf>=4.0.0
Provides-Extra: dev
Requires-Dist: grpcio-tools>=1.50.0; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Requires-Dist: requests; extra == "dev"

# 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

```bash
pip install herd-client
```

## Quick Start (Async)

```python
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)

```python
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())
```
