Support custom headers or stable chat session identifiers for BYOK/OpenAI-compatible model providers #56970
albayrakonur
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
I would like Zed BYOK model configuration to support either custom static request headers for OpenAI-compatible providers, or a stable per-chat session identifier that is sent with every request in the same chat session.
Background
I am using locally deployed OpenAI-compatible models with BYOK in Zed. In my setup, the local inference server is backed by vLLM, and request-level metadata can be useful for cache management, routing, and session-aware behavior.
For example, when using vLLM or a proxy in front of it, I can enable more effective cache usage by sending stable headers such as a tenant/session/cache key header. Some other extensions that support custom OpenAI-compatible providers already allow this. For example, Kilo Code for VS Code lets users configure custom headers when adding a custom OpenAI-compatible provider.
When I inspected the requests sent by Zed, I could see request/completion identifiers that change per prompt, but I could not find a stable value that remains the same for all prompts in the same chat window/session. This makes it difficult for local providers or proxies to associate related requests with the same chat session for caching or routing purposes.
Proposed solution
It would be helpful if Zed supported one or both of the following for BYOK/OpenAI-compatible providers:
Allow users to configure custom static headers per model/provider.
Example:
{ "X-Cache-Key": "my-local-model", "X-Provider-Mode": "local" }Automatically generate and send a stable chat/session identifier for each chat window or conversation.
X-Chat-Session-Id: <stable-id-for-this-chat>This value would remain stable for all prompts in the same chat session, but change for a new chat session.
Why this would be useful
This would make BYOK more practical for local and self-hosted model deployments, especially when the provider or proxy needs stable metadata for:
Since Zed appears to be investing more in BYOK and custom model provider support, this would make the feature more flexible for local/self-hosted model users without requiring provider-specific hardcoding.
Existing behavior in other tools
Some extensions for other IDE already support this kind of configuration. For example, Kilo Code for VS Code allows custom headers when configuring a custom OpenAI-compatible provider. A similar capability in Zed native BYOK support would be very useful.
Alternatives considered
A provider-side proxy can sometimes infer or generate its own session keys, but without a stable identifier from the client, it cannot reliably group requests from the same chat session. Per-request completion IDs are not enough for this use case because they change with every prompt.
Kilo Code Implementation
Beta Was this translation helpful? Give feedback.
All reactions