The Python SDK exports a single, synchronousDocumentation Index
Fetch the complete documentation index at: https://docs.devhelm.io/llms.txt
Use this file to discover all available pages before exploring further.
Devhelm client built on httpx.Client. There’s no AsyncDevhelm in v0.4.0 — but because httpx releases the GIL for I/O, the sync client parallelizes well from a thread pool, which covers nearly every concurrent workload.
A native async client (
AsyncDevhelm on httpx.AsyncClient) is on the roadmap. If you need true asyncio integration, file a request at github.com/devhelmhq/sdk-python/issues — until then, the patterns below cover essentially every concurrent workload.When to use concurrency
| Use case | Recommended approach |
|---|---|
| Single script with a handful of calls | Sync calls, no concurrency |
| Bulk operations (many creates/updates) | Thread pool (see below) |
| FastAPI / async web handler | asyncio.to_thread(...) per call |
| Background worker fanning out to many monitors | Thread pool with bounded max_workers |
Pattern 1: Thread pool
concurrent.futures.ThreadPoolExecutor is the simplest way to parallelize SDK calls. Set max_workers to a modest number (8–16) to avoid hitting API rate limits.
Devhelm is safe to share across threads — it wraps a single httpx.Client with a connection pool.
Pattern 2: asyncio.to_thread from async code
Inside async def handlers (FastAPI, Starlette, aiohttp, etc.), wrap each call in asyncio.to_thread to keep the event loop free:
min(32, os.cpu_count() + 4)).
Bulk creates with error isolation
Rate-limiting tips
- Cap
max_workersto 8–16 by default. Higher concurrency rarely improves throughput against a rate-limited API. - Catch
DevhelmRateLimitErrorand back off usinge.retry_after. - Reuse a single
Devhelminstance across threads — its connection pool amortizes TLS handshakes.
Next steps
Client reference
Full method reference for all resources.
Error handling
Exception types and retry patterns.