feat: add http_headers support to LlmProvider for custom upstream headers (fixes #592)

Allows users to specify custom HTTP request headers per LLM provider in
plano_config.yaml, useful for providers requiring non-standard auth or
telemetry headers:

  model_providers:
    - model: provider/model
      access_key: $API_KEY
      http_headers:
        X-Custom-Header: "custom-value"
        X-API-Version: "v1"
This commit is contained in:
Octopus 2026-04-03 15:09:29 +08:00
parent aa16a6dc4b
commit b85fab8696
4 changed files with 22 additions and 0 deletions

View file

@ -445,6 +445,7 @@ pub struct LlmProvider {
pub base_url_path_prefix: Option<String>,
pub internal: Option<bool>,
pub passthrough_auth: Option<bool>,
pub http_headers: Option<HashMap<String, String>>,
}
pub trait IntoModels {
@ -488,6 +489,7 @@ impl Default for LlmProvider {
base_url_path_prefix: None,
internal: None,
passthrough_auth: None,
http_headers: None,
}
}
}

View file

@ -277,6 +277,7 @@ mod tests {
internal: None,
stream: None,
passthrough_auth: None,
http_headers: None,
}
}