Skip to main content

Oriora c2 — a local proxy that plugs Oriora's model-routing decision into any OpenAI-style agent. Your vendor key and prompts stay on your machine; only the routing decision crosses.

Project description

oriora-c2

Use Oriora's model-routing decision in any OpenAI-style agent — without your key or prompts ever leaving your machine.

oriora-c2 runs a tiny local proxy on 127.0.0.1. Your agent points at it; before each call it asks Oriora's /api/select "which model is best for this task?", then dispatches the call directly to the vendor on your own key. Only the routing decision (task type + your candidate models) crosses to Oriora — never the key, the prompt, or the response.

This is for off-the-shelf agents (Cursor, Aider, Continue, the raw openai SDK, LangChain ChatOpenAI, …) that can't easily insert a "ask Oriora first" step. Writing your own code? You don't need this — call /api/select directly (or pip install oriora and use model_select()).

Install

pip install oriora-c2

Run

oriora-c2 init                       # scaffolds config.yaml + .env.oriora-c2.example
# set your keys:
export ORIORA_API_KEY=sk_oriora_...  # the decision call only
export DEEPSEEK_API_KEY=...          # your own vendor keys (the actual call runs on these, locally)
export MINIMAX_API_KEY=...
oriora-c2 serve                      # local proxy on http://127.0.0.1:4000

Point any OpenAI client at it:

from openai import OpenAI
c = OpenAI(base_url="http://127.0.0.1:4000/v1", api_key="anything")
c.chat.completions.create(model="oriora-auto", messages=[{"role":"user","content":"…"}])
# task type is auto-detected locally (free); or force it: model="oriora-auto:coding"

How it works

  1. Agent → http://127.0.0.1:4000 (model="oriora-auto"). Prompt never leaves your box.
  2. The pre-call hook classifies the task locally (free regex rules, no LLM) → calls POST /api/select {task_type, models} — the one Oriora touch ($0.001/decision).
  3. It rewrites data["model"] to the recommended model.
  4. LiteLLM dispatches direct to the vendor on your local key; the stream flows vendor → you.

Privacy / c2 invariant: the proxy is customer-hosted (127.0.0.1). Only {task_type, model candidates} reach Oriora. If a third party ever hosted this, it would no longer be c2.

Fail-open: if /api/select is slow (>ORIORA_SELECT_TIMEOUT_S, default 2.5s) or down, the hook falls back to ORIORA_FALLBACK_MODEL so your agent is never blocked.

Configuration (env)

Var Purpose
ORIORA_API_KEY Oriora key for the decision call (required)
DEEPSEEK_API_KEY, MINIMAX_API_KEY, … your own vendor keys (the call runs on these)
ORIORA_CANDIDATES comma-sep catalog ids you hold keys for (sent to /api/select)
ORIORA_FALLBACK_MODEL model used if the decision call fails (default deepseek-v4-flash)
ORIORA_SELECT_TIMEOUT_S decision-call budget before fail-open (default 2.5)

Add a vendor = add its key + a model_list entry in config.yaml + its catalog id to ORIORA_CANDIDATES. v1 ships configured for DeepSeek + MiniMax (OpenAI-format).

MIT © Orioralabs OÜ · https://orioralabs.com

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

oriora_c2-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

oriora_c2-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oriora_c2-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for oriora_c2-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c61baf632f344a92d2e314c078e7f97243c5b2a6fb30fe932ad1de0c72f606e9
MD5 ab948401fdc2b55d27bed50decdd4119
BLAKE2b-256 40c6b9169d1896b0261bee303b91e3a9b5314501217361132444dc178deea086

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oriora_c2-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for oriora_c2-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b11c75bfe22036284d3be43b2927242ee5608e4674d5c5036468fbac380c5dfd
MD5 d89aad18482cc537970a773f3342b6c2
BLAKE2b-256 88f3300d7452933b7df96f33cf00bbf55dee366549372e464253935c31e82400

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