Python SDK
The Python SDK provides a complete toolkit for integrating Adaline’s LLM deployment and observability features into your AI applications. The SDK is fully async and usesasyncio throughout.
Installation
pip
Quick Start
Type Definitions
The SDK uses types from theadaline_api package:
Resource management
Beyond deployments and monitoring,Adaline exposes seven namespace clients that cover the platform’s full REST surface. Each method is async, retries 5xx responses, aborts on 4xx, and uses keyword-only arguments:
- DatasetsClient
- PromptsClient
- ProvidersClient · ModelsClient · ProjectsClient
- PromptEvaluatorsClient — evaluator CRUD (scoped to a prompt)
- PromptEvaluationsClient — evaluation runs, with
.resultssub-client for per-row output - LogsClient — read-side log access (+
.traces,.spans)
with_retry helper:
Error Handling
The SDK uses automatic retry logic with exponential backoff for API calls:- 5xx errors: Automatically retried with exponential backoff (1s, 2s, 4s, … capped at 10s) within a 20s budget
- 4xx errors: Fail immediately (no retry)
monitor.dropped_count. Successfully sent entries are tracked via monitor.sent_count.
Real-World Example: RAG Pipeline
API Reference
Adaline Class
Core client for deployments and monitoring.
Monitor Class
Buffered log submission with automatic flushing.
Trace Class
High-level operation tracking.
Span Class
Granular operation tracking with content types.