Gateway (drop-in)
Do not replace your model provider. Put NeuraFrame™ in front of it. Point your app at NeuraFrame™ instead of your model, change nothing else, and get the savings.
How it works
NeuraFrame™ runs a reuse-aware reverse proxy in front of your model. Your app sends its normal request to NeuraFrame™. On a repeat, NeuraFrame™ answers from memory; on a miss, it forwards the request to your real model and returns that response unchanged, then remembers it.
client app -> NeuraFrame gateway -> your model (upstream)
hit : served from memory, no upstream call
miss : forwarded, model response returned, remembered
The only change on your side is one base URL.
Works with any model API
The gateway has two layers of compatibility:
- Universal exact layer. It keys on the normalized request, so an identical repeat replays the stored response byte for byte. This needs no knowledge of your API schema, so it works with any HTTP JSON model endpoint (OpenAI style, other local servers, custom APIs). It delivers the exact-recurrence savings.
- Meaning layer. For known profiles (OpenAI and OpenAI-compatible chat and completions, Anthropic Messages, Grok and xAI, and the native llama.cpp endpoints) it also reads the prompt and answer so it can apply semantic reuse and routing, the deeper NeuraFrame™ benefits.
Point your app at it
Two steps: set the gateway's upstream to your provider, then change your app's base URL to the gateway (default http://127.0.0.1:8081). Set gateway.upstream_url to your provider and gateway.profile to match it. The auto profile detects OpenAI-style and Anthropic-style requests by path, so one gateway can front both.
sudo nano /etc/neuraframe-studio/config.json # edit the "gateway" block
sudo systemctl restart neuraframe-studio
| Provider | gateway.upstream_url | gateway.profile | point your app at |
|---|---|---|---|
| OpenAI | https://api.openai.com | openai or auto | http://127.0.0.1:8081/v1 |
| Anthropic | https://api.anthropic.com | anthropic or auto | http://127.0.0.1:8081 |
| Grok / xAI | https://api.x.ai | grok or auto | http://127.0.0.1:8081/v1 |
| Compatible / local | your endpoint base URL | auto | http://127.0.0.1:8081 |
Your provider API key travels on the request from your app exactly as it does today; the gateway passes it straight through. OpenAI and xAI use Authorization: Bearer, Anthropic uses x-api-key and anthropic-version, and any custom header a compatible endpoint needs is forwarded too.
# example: Anthropic through the gateway, the same request you send today
curl http://127.0.0.1:8081/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-5","max_tokens":64,"messages":[{"role":"user","content":"say hi"}]}'
Streaming and misses
A miss is exactly like talking to your model directly: the request is forwarded unchanged and the response is returned unchanged (byte identical), including streamed responses. Streaming repeats use the exact layer; semantic reuse applies to non streaming requests.
If your provider is unreachable
NeuraFrame™ only ever returns a verified answer from memory or your provider's real response. If a request is not in memory and the gateway cannot reach your provider (down, refused, or timed out), it returns a clear error saying so rather than inventing an answer. Anything it has already learned still serves from memory, so a growing NeuraFrame™ keeps working even when calls to the provider become rare.
Licensing and pass-through
When unlicensed or expired, the gateway forwards everything and serves nothing from memory, so it is fully transparent. Your model keeps working; you simply lose the savings until you renew.
Teaching is optional
A plain model API has no concept of a correction, so teaching happens through the neuraframe CLI or the native API, not the proxy path. You get reuse and energy savings with zero code change; teaching is an opt-in extra when you want future answers to change.