Skip to main content

InferenceIQ - AI inference cost optimization. Drop-in replacement for OpenAI SDK.

Project description

InferenceIQ Python SDK

Drop-in replacement for the OpenAI Python SDK that automatically optimizes every inference request — cutting costs by up to 40% with intelligent model routing, semantic caching, and prompt compression.

Installation

pip install inferenceiq

Quick Start

from inferenceiq import InferenceIQ

# Drop-in OpenAI replacement
client = InferenceIQ(api_key="iq-live_...")

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)

Features

  • OpenAI-compatible: Swap openai.OpenAI() for InferenceIQ() — same API
  • Automatic cost optimization: Intelligent model routing saves 25-40%
  • Semantic caching: Identical/similar requests served from cache
  • Quality guarantees: Set minimum quality thresholds per request
  • Full observability: Per-request cost attribution and savings tracking

Native API

# Use the native optimization API for more control
result = client.optimize(
    prompt="Summarize this document...",
    strategy="balanced",        # cost_optimized | balanced | quality_first | latency_optimized
    quality_threshold=0.85,
    max_cost_per_token=0.00003
)

print(f"Saved: ${result.savings:.4f}")
print(f"Provider: {result.provider_used}")

Links

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

inferenceiq-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

inferenceiq-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file inferenceiq-0.1.0.tar.gz.

File metadata

  • Download URL: inferenceiq-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for inferenceiq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82c0a86dd0795c2cb8c7d1876923b256ffe5076251c1b41d2926195a5c35ec99
MD5 811b3049e258477125f153e1f65eb962
BLAKE2b-256 a4e6666d267ea604fca1765aaa7f02eeda09709e027e561b385e4807189ffe14

See more details on using hashes here.

File details

Details for the file inferenceiq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: inferenceiq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for inferenceiq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1232a307c8328a3793581df395eed8d404132ff02bfc2feb4edb931a9557f1e3
MD5 5f07b0639e17b556930d1de5bd0dd383
BLAKE2b-256 ea196e1bed02ab9ec17d30841a920822242925350b2043d4a2d0bf2f94c5b25e

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