Skip to content

vmcp optimizer: allow custom HTTP headers on the OpenAI embedding client #5700

Description

@gabrielcosi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions