Skip to main content

Production-ready SDK for the Indro Edge API

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

indro-1.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

indro-1.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file indro-1.0.1.tar.gz.

File metadata

  • Download URL: indro-1.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for indro-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c95784ae1c6e85b877473debec8110e47ae51a9c7d467af4885ae5bb92faf038
MD5 e5804ffcef00b7b923bceb891dadf5fd
BLAKE2b-256 20f8ed366a5a6d3930ff4ff1610d4f7d5738fafb53032feaab96cbf388320c3b

See more details on using hashes here.

File details

Details for the file indro-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: indro-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for indro-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8ede552ebee4c1d3d349eccb4e2354208e0ece519ef91ddb274fc7123b75bd6
MD5 a79c1f7b023dbe30d815a513b2a8fabd
BLAKE2b-256 d2884e788a644e64df804afba18f4650cca99391af82f047218641a1b299a2b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page