Follow-up to #5305 / #5633. The OpenAI embedding client sets only Content-Type and Authorization (openai_client.go, embedChunk), so there's no way to add a header.
The gateways this path targets (Bifrost, LiteLLM) often key behavior off a request header. Mine is Bifrost's x-bf-cache-key, which scopes its response cache to a subset of traffic. Without it, caching is all-or-nothing at the gateway, so I can't enable it for just the optimizer's embedding calls.
Proposal
Add an optional embeddingHeaders (map[string]string) to spec.config.optimizer, applied by the OpenAI client on each request. OpenAI path only; the TEI-native protocol doesn't sit behind these gateways. Headers only, no body params. Absent field keeps today's behavior. Happy to PR.
Follow-up to #5305 / #5633. The OpenAI embedding client sets only
Content-TypeandAuthorization(openai_client.go,embedChunk), so there's no way to add a header.The gateways this path targets (Bifrost, LiteLLM) often key behavior off a request header. Mine is Bifrost's
x-bf-cache-key, which scopes its response cache to a subset of traffic. Without it, caching is all-or-nothing at the gateway, so I can't enable it for just the optimizer's embedding calls.Proposal
Add an optional
embeddingHeaders(map[string]string) tospec.config.optimizer, applied by the OpenAI client on each request. OpenAI path only; the TEI-native protocol doesn't sit behind these gateways. Headers only, no body params. Absent field keeps today's behavior. Happy to PR.