mirror of
https://github.com/katanemo/plano.git
synced 2026-05-18 13:45:15 +02:00
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:
parent
aa16a6dc4b
commit
b85fab8696
4 changed files with 22 additions and 0 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ mod tests {
|
|||
internal: None,
|
||||
stream: None,
|
||||
passthrough_auth: None,
|
||||
http_headers: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue