Production-ready SDK for the Indro AI Ecosystem
Project description
Indro SDK
Production-ready Python SDK for the Indro Edge API.
The Indro SDK provides a secure, high-performance, enterprise-grade client for interacting with the Indro Edge inference platform.
Base API Endpoint:
https://abhinav337463-indro-edge-api.hf.space
Features
Core Features
- Fully typed API
- Automatic request serialization
- Automatic response parsing
- GET, POST, PUT, PATCH, DELETE support
- JSON requests
- Form data requests
- Multipart file uploads
- Streaming response support
- Connection pooling
- Keep-alive support
- Batch request support
- Request cancellation
- Request deduplication
- Offline request queue
- Middleware system
- Interceptor system
- Plugin system
- Event hooks
- Fluent API design
Security Features
- API Key Authentication
- Bearer Token Authentication
- Custom Header Authentication
- Secure HTTPS enforcement
- SSL validation
- Request signing
- HMAC support
- Header sanitization
- Input sanitization
- Output sanitization
- Secret masking in logs
- Anti-injection protections
- Secure error handling
- Environment variable support
Performance Features
- In-memory cache
- Persistent cache
- Smart cache invalidation
- Compression support
- Lazy loading
- Request prioritization
- Concurrent request management
- Queue management
- Optimized memory usage
Monitoring Features
- Request metrics
- Performance metrics
- Latency tracking
- Correlation IDs
- Request tracing
- Error tracking
- Health checks
- Telemetry hooks
Installation
Install directly:
pip install indro
Development installation:
pip install indro[dev]
WebSocket support:
pip install indro[ws]
Secure token storage support:
pip install indro[keyring]
Quick Start
from main import IndroClient
client = IndroClient()
result = client.predict( model_name="house-price-model", features=[ 1200, 3, 2, 5 ] )
print(result.prediction)
Initialization
Basic:
from main import IndroClient
client = IndroClient()
Custom endpoint:
client = IndroClient( base_url="https://abhinav337463-indro-edge-api.hf.space" )
Debug mode:
client = IndroClient( debug=True )
Verbose logging:
client = IndroClient( verbose=True )
Authentication
API Key
client = IndroClient( api_key="YOUR_API_KEY" )
Bearer Token
client = IndroClient( bearer_token="YOUR_TOKEN" )
Custom Headers
client = IndroClient( headers={ "X-Custom": "value" } )
Available API Methods
List Models
Maps to:
GET /api/models
Example:
models = client.models()
print(models.models)
Predict
Maps to:
POST /api/predict
Example:
response = client.predict( model_name="house-price-model", features=[ 1200, 3, 2, 5 ] )
print(response.prediction)
Async Predict
response = await client.predict_async( model_name="house-price-model", features=[1,2,3,4] )
Batch Requests
responses = client.batch_predict([ { "model_name": "model-a", "features": [1,2,3] }, { "model_name": "model-b", "features": [4,5,6] } ])
Health Checks
The SDK includes helpers for operational endpoints.
Health
health = client.health()
Endpoint:
GET /health
Readiness
ready = client.ready()
Endpoint:
GET /ready
Metrics
metrics = client.metrics()
Endpoint:
GET /metrics
SLO Dashboard
slo = client.slo()
Endpoint:
GET /slo
Caching
Enable memory cache:
client = IndroClient( cache_enabled=True )
Custom TTL:
client = IndroClient( cache_ttl=300 )
Clear cache:
client.cache.clear()
Retry System
Automatic retry support:
client = IndroClient( retries=5 )
Exponential backoff:
client = IndroClient( retry_backoff_factor=2 )
Timeout Management
client = IndroClient( timeout=60 )
Per request:
client.predict( model_name="my-model", features=[1,2,3], timeout=120 )
Middleware
def middleware(request): print(request.url) return request
client.add_middleware(middleware)
Interceptors
Request interceptor:
client.interceptors.request.use( lambda req: req )
Response interceptor:
client.interceptors.response.use( lambda res: res )
Event Hooks
@client.on("request") def on_request(event): print(event)
@client.on("response") def on_response(event): print(event)
@client.on("error") def on_error(event): print(event)
Error Handling
Base error:
from main import IndroSDKError
Authentication:
from main import AuthenticationError
Validation:
from main import ValidationError
Timeout:
from main import TimeoutError
Network:
from main import NetworkError
Server:
from main import ServerError
Retry exhaustion:
from main import RetryExhaustedError
Example:
try: client.predict( model_name="demo", features=[1,2,3] ) except ValidationError: pass except NetworkError: pass
Environment Variables
INDRO_BASE_URL=https://abhinav337463-indro-edge-api.hf.space
INDRO_API_KEY=your_api_key
INDRO_BEARER_TOKEN=your_token
INDRO_TIMEOUT=60
INDRO_DEBUG=false
Production Recommendations
For production deployments:
client = IndroClient( timeout=60, retries=5, cache_enabled=True, verify_ssl=True, keep_alive=True, compression=True )
API Compatibility
Compatible with:
- Indro Edge API v3.x
- Future v3 minor releases
- Backward compatibility layer included
Thread Safety
The SDK is designed to be thread-safe and suitable for:
- Web servers
- FastAPI
- Django
- Flask
- Background workers
- Microservices
- Enterprise applications
License
MIT License
Copyright (c) 2026
Abhinav Anand
Example
from main import IndroClient
client = IndroClient( debug=True, cache_enabled=True )
models = client.models()
print(models.models)
prediction = client.predict( model_name=models.models[0], features=[1.0, 2.0, 3.0, 4.0] )
print(prediction)
Built for the Indro Edge ecosystem.
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 indro-1.0.2.tar.gz.
File metadata
- Download URL: indro-1.0.2.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0130d34b74babb9200f976b2807515c802a0ba5e8bc3460039f586f72eb42c7
|
|
| MD5 |
a48469a33ec5939644e733dd3bbd1477
|
|
| BLAKE2b-256 |
9f00c1da0270545739c7250e5587feff8a4e924d3d4918f60449a5a42a84bf30
|
File details
Details for the file indro-1.0.2-py3-none-any.whl.
File metadata
- Download URL: indro-1.0.2-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c8922fe1d3b69ce00dc52ff144e96fa48729f67354200d73ecc083e571a7e8
|
|
| MD5 |
82cb770c29e294e059cf67669cef2259
|
|
| BLAKE2b-256 |
4431890ebbeffa3faa6a57c97222eafd1606ad5b58bad35d35281f40b2153c6d
|