LinuxAir

LinuxAir documentation

LinuxAir is an OpenAI-compatible endpoint that sends each request to the cheapest of your models that is predicted to be as good as the best one.

Key concepts

TermMeaning
WorkspaceYour account's container for providers, models, API keys, requests and credits.
ProviderA connection to a model API (OpenAI, Anthropic, Groq, Ollama…) using your own key.
ModelA specific model on a provider that takes part in routing, with its prices and context window.
Probe setA shared set of test prompts across task types, used to measure every model the same way.
ClusterA group of similar prompts (for example code or structured output). About eight by default.
FingerprintA model's error rate in each cluster — what the router uses to predict quality.
Tolerance (τ)The most predicted quality you'll give up to save money.
Price weight (λ)How eagerly the router takes a cheaper model among near-equals.
Answer checkA judge model scoring an answer and escalating weak ones to a stronger model.
CreditsThe unit for platform fees: per routed request and per model fingerprint.
Semantic cacheReuse of an earlier answer for a near-identical prompt — no tokens, no credits.
Eval setPrompts from your own traffic that models are scored on.
Shadow testA sampled request quietly re-run on a second model and judged.
RoleOwner, Developer or Viewer — what a workspace member may do.

The request lifecycle

  1. Your app calls POST /v1/chat/completions with a LinuxAir key and model: "auto".
  2. Sensitive values are masked if redaction is on, and the semantic cache is checked — a hit returns immediately, free.
  3. The prompt is embedded and matched to its nearest clusters.
  4. Each eligible model's quality is predicted from its fingerprint, with an uncertainty range.
  5. Models outside your tolerance are dropped; the best value among the rest is chosen.
  6. The request is sent to that model on your provider key. On a provider error, the next candidate is tried.
  7. If a weaker model was chosen or the router was unsure, a judge may check the answer and escalate once.
  8. The response returns with a linuxair block explaining the decision, and the request is logged.
New here? Start with the Quickstart, then read Routing & policy to choose the right trade-off.