FluxCompute SDK
Route every query to the cheapest model that can answer it
FluxCompute classifies each request and dispatches it to the right tier, so simple questions stop costing frontier-model prices, and reports exactly what you saved on every call.
Install
pip install fluxcompute
Python 3.10 or newer. The SDK is Apache-2.0 licensed and has no FluxCompute account requirement: routing and savings accounting work entirely against your own provider keys.
Your first routed call
import asyncio from fluxcompute import FluxClient async def main(): client = FluxClient(anthropic_key="sk-ant-...") response = await client.messages.create( model="auto", # let FluxCompute decide messages=[{"role": "user", "content": "What is 2+2?"}], ) print(response.text) # "4" print(response.fluxcompute.model_selected) # claude-haiku-4-5-20251001 print(response.fluxcompute.savings_usd) # 0.00016 await client.close() asyncio.run(main())
Migrating from the Anthropic or OpenAI SDK
Swap the client and pass model="auto". The response object keeps the fields you
already use, with routing and cost data added under response.fluxcompute. Pin a
specific model any time by passing it instead of "auto".
Keys are read from the environment when not passed explicitly, matching the provider SDK conventions. See Configuration.
Where to go next
How routing works
Difficulty scoring, the three tiers, and how savings are measured.
Execution graphs
Record a DAG of every LLM call and step, then resume a failed one.
Telemetry & privacy
What leaves the process, what never does, and how to turn it off.
Examples
Two notebooks, and two complete agents with recorded runs: a company brain and a CRM inbox.