Robot Resources — cache-aware LLM model routing for Python agents. Auto-attaches Anthropic, OpenAI, and Google (google-genai) SDKs to a local router sidecar (default ON; opt out with RR_AUTOATTACH=0).
Project description
robot-resources
Cache-aware LLM model routing for Python agents — install it and your
agent's Anthropic, OpenAI, and Google (google-genai) calls route through a
local engine that picks the cheapest model that can do each turn, per request,
cache-aware. Your API keys flow straight to the labs; routing happens at a
loopback proxy.
pip install robot-resources
Alpha: install via the wizard —
npx @robot-resources/cli— which sets up the sidecar runtime and your (anonymous) account. Requires Node ≥ 18 on the machine (the routing engine runs as a sidecar child process).
How it works
This package is a thin attach shim, not a routing engine. On interpreter
startup (via a .pth hook, like coverage/ddtrace) it:
- Spawns — or reuses — a local router sidecar (
@robot-resources/router, a Node child process that dies with your agent; never a daemon). - Points
ANTHROPIC_BASE_URL/OPENAI_BASE_URL/GOOGLE_GEMINI_BASE_URLat that sidecar only after it answers a health check — so if the sidecar can't start, your SDKs talk to the real APIs unchanged (fail open).
No code changes, nothing to import.
Controls
| Env var | Effect |
|---|---|
RR_AUTOATTACH=0 |
Kill switch — raw SDKs, no sidecar. |
RR_ROUTING=0 |
Attach but never switch models (passthrough). |
RR_PORT=<port> |
Override the loopback port (default 18790). |
RR_ROUTER_DEBUG=1 |
Print attach/routing decisions to stderr. |
SDK support
| SDK | Routed |
|---|---|
anthropic |
✅ |
openai (≥ 1.0) |
✅ |
google-genai (new unified SDK) |
✅ |
google-generativeai (legacy, deprecated) |
❌ — pip install google-genai |
MIT licensed. Part of Robot Resources.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robot_resources-1.0.0a1.tar.gz.
File metadata
- Download URL: robot_resources-1.0.0a1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfb4c6ce366bafb2ab9f675402b592129af72835f233f17722047996d5bdd8c2
|
|
| MD5 |
62244cb7288d59310335bb6c3831bb07
|
|
| BLAKE2b-256 |
f9254d934c9705455ee0b4d81d4ede313bd2f9f9fd45e3d8ce1e156a81309b5b
|
File details
Details for the file robot_resources-1.0.0a1-py3-none-any.whl.
File metadata
- Download URL: robot_resources-1.0.0a1-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2def347e9565b6b77f6c93977d8676767f4912bfa390e4036da638b509eb0774
|
|
| MD5 |
17264cdc80061c1de682302efde184de
|
|
| BLAKE2b-256 |
c5579aaf9c64a6322e8b408e9bcea198d9a55cb10d2b048a7b895842c39d7663
|