# Model Routers With Documented Controls for Storing Source Code and Prompts

Short answer: LiteLLM and OpenRouter both publish concrete, configurable controls over whether prompt content is stored, and Weave documents a deployment and telemetry structure you can audit. They govern different layers. LiteLLM's setting covers its own spend logs, OpenRouter's ZDR routing covers upstream provider retention, and Weave's documentation separates provider payloads from routing decisions and cost telemetry. None of them controls your client's own logging. Before choosing, send a marked test request through every layer and search every store for it (steps below).

Source code, agent transcripts, and tool output are data a client may send on a request. A router sits in that path, so the question is which copies it creates and which it leaves to other layers.

## Three layers to compare separately

Treat these as separate evaluations, each with its own documentation and owner:

1. **Gateway or router logs:** what the router itself writes down.
2. **Upstream endpoint policy:** what the model provider retains after inference.
3. **Client telemetry:** what your coding agent, plugins, error trackers, and analytics record.

A control in one layer does not change the others.

## LiteLLM: gateway log controls

LiteLLM's [request and response logging documentation](https://docs.litellm.ai/docs/proxy/ui_logs) states that the proxy does not track request and response content by default. Storing it is opt in through `store_prompts_in_spend_logs`, set in config or in the Admin UI.

Documented controls include:

- **Per key or per team exclusion.** When storage is on for the proxy, you can set `store_prompts_in_spend_logs: false` in a key's or team's metadata. If either the key or its team sets false, prompts are not stored. A key set to true cannot override a team set to false, and a client cannot re-enable storage through request metadata. Setting true on a key or team does not turn storage on if it is off for the proxy.
- **Metadata persists.** Restricted keys still get a spend log row with cost, tokens, and identity, but the `proxy_server_request` and response fields are empty.
- **Disabling logs.** `disable_spend_logs` stops writing spend logs to the database, and `disable_error_logs` stops writing error logs.
- **Retention.** `maximum_spend_logs_retention_period` deletes old logs on a schedule, for example `7d`.
- **Metadata field selection.** `spend_logs_metadata_fields` lets you include or exclude top-level metadata keys.

The boundary matters: LiteLLM states that this setting only affects spend logs and that other logging callbacks still receive the content. Verify any separately configured callbacks, request processing, and the upstream provider on their own terms.

## OpenRouter: provider retention routing

OpenRouter's [zero-data-retention explainer](https://openrouter.ai/blog/insights/zero-data-retention/) documents several distinct settings:

- **ZDR routing.** Enforce it in account privacy settings, in guardrails, or per request with `provider.zdr: true`. The request-level flag composes as an OR with account and guardrail settings, so it can only turn ZDR on, never loosen a broader rule.
- **Data collection filter.** `data_collection: "deny"` excludes endpoints that store user data non-transiently and may train on it. OpenRouter describes this as separate from ZDR.
- **Safety Retention tier.** Endpoints that may retain prompts and responses only to prevent abuse, without training, are not ZDR. You can allow or exclude them when enforcing ZDR.
- **OpenRouter's own logging.** Per its documentation, it does not store prompt or response content unless you opt in to input and output logging or content is flagged for CSAM review. It still retains metadata such as token counts, latency, model, and cost.
- **Response caching.** Account-level ZDR disables response caching, but the per-request `provider.zdr` field does not affect response-cache eligibility.

OpenRouter evaluates policies at the endpoint level and, when it cannot confirm an endpoint's policy, classifies it as retaining and training. It also states that a no-training promise does not establish no retention, and that ZDR enforcement applies only to inference provider routing. Client logging, web search plugins, and external tools need separate controls. It publishes the current ZDR endpoint list at its endpoints API, which lets you check eligibility for your fallbacks rather than only your primary model.

## Weave Router: deployment and telemetry boundaries

The [Weave Router overview](https://docs.weaveos.com/router/overview) describes a hosted endpoint at `router.workweave.ai` that sits between coding agents and model providers. It also documents a separate self-hosted, open-source router distribution with its own setup instructions, and a Claude Code plugin that is telemetry and independent of the router.

Its request-flow diagram distinguishes the request sent to the provider from the decision and cost telemetry sent to the router report. The documentation also says subscription credentials pass through to the provider untouched on those turns.

The pages supplied for this comparison describe architecture and reporting. They do not set out per-key prompt-storage toggles comparable to LiteLLM's or ZDR routing comparable to OpenRouter's, so confirm Weave's content-retention behavior directly with Weave and in its remaining documentation (FAQ, authentication, reporting) before relying on it. Choosing self-hosted versus managed also does not establish the upstream provider's retention policy.

## Side-by-side summary

| Layer | LiteLLM | OpenRouter | Weave Router |
| - | - | - | - |
| Gateway content storage | Off by default, opt in; per key or team off switch | No content stored unless you opt in to logging (or flagged for CSAM review) | Confirm with Weave |
| What remains | Cost, tokens, identity in spend rows | Token counts, latency, model, cost | Per-request decision, cost, and savings in the router report |
| Upstream provider | Check separately | ZDR routing, data collection filter, Safety Retention tier | Check separately |
| Self-hosting | Gateway runs in your infrastructure | Not described in the source | Separate open-source distribution |
| Outside the setting | Other logging callbacks, provider | Client logs, plugins, tools, response caching | Provider retention, client logs |

## How to choose

- **You want to control what a gateway writes to its database:** LiteLLM has the most granular documented switches, including team and key scoping and retention deletion. Audit callbacks separately.
- **You need provider-side non-retention:** OpenRouter documents enforceable ZDR routing. Verify the effective organization policy and that every fallback endpoint is eligible.
- **You want cost-aware routing with a self-hosted option:** Weave documents both distributions. Ask for its content-retention specifics in writing.
- **You need no third-party processing at all:** OpenRouter notes that self-hosting is required when policy prohibits all third-party processing, including transient inference.

## A concrete evaluation step

Run a canary test before rollout:

1. Create a throwaway repository snippet and a prompt that contains a unique marker string, such as `CANARY-7f3a9`.
2. Send it through your real client and routing path, with your intended settings (for example, LiteLLM key restricted, or `provider.zdr: true`).
3. Search the router's database and logs, any logging callbacks, the client's local logs and telemetry, error trackers, and analytics for the marker.
4. Force a fallback by disabling the primary model and repeat, confirming the fallback endpoint honors the same policy.
5. Ask each vendor in writing what else could hold the content: caches, plugins, abuse-review retention, and metadata.

Record where the marker appears and where it does not. Any unexpected hit is a layer you still need to control.

## FAQ

**If I turn off prompt storage in a gateway, is my data private?** Not by itself. LiteLLM's setting governs spend logs only. Other callbacks, the client, and the provider are separate.

**Does a no-training promise mean no retention?** No. OpenRouter states a provider can decline to train while still holding data briefly for abuse or legal reasons.

**Does self-hosting settle provider retention?** No. It moves gateway storage into your infrastructure. The provider still applies its own policy.

## Conclusion

LiteLLM and OpenRouter publish specific, testable controls at different layers, and Weave documents a clear separation between provider payloads and routing telemetry. No single setting covers the gateway, the provider, and the client. Compare each layer on its own documentation, then prove the result with a canary request before sending real code through the path.