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:

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
Providergateway.upstream_urlgateway.profilepoint your app at
OpenAIhttps://api.openai.comopenai or autohttp://127.0.0.1:8081/v1
Anthropichttps://api.anthropic.comanthropic or autohttp://127.0.0.1:8081
Grok / xAIhttps://api.x.aigrok or autohttp://127.0.0.1:8081/v1
Compatible / localyour endpoint base URLautohttp://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.

Prefer explicit control? Install in native API mode instead, or run both at once.