8 views
-/https://github.com/berriai/litellm/issues/27434
GitHub · issue

#27434 openai-provider models silently send empty Bearer header when api_key is configured as a literal string

  • State: open
  • Author: @poodle64
  • Labels: llm translation

## Description

`openai/*` provider models in `model_list` whose `litellm_params.api_key` is a literal (non-`os.environ/`) string emit an empty `Authorization: Bearer ` header at request time. httpx rejects this client-side with `Illegal header value b'Bearer '`, so the request never reaches the upstream OpenAI-compatible server.

The proxy stores the configured value (visible after restart in the YAML or DB), but the value isn't reaching the wire.

## Reproduction

1. `config.yaml`:

```yaml model_list: - model_name: claudette/sonnet litellm_params: model: openai/claude-sonnet-4-6 api_base: http://172.30.0.8:8420/v1 api_key: dummy-key-claudette-handles-auth ```

2. Start proxy. Startup log shows the model loaded. 3. POST `/v1/chat/completions` with `model: claudette/sonnet` and any short message. 4. Proxy returns:

``` Unexpected error: Illegal header value b'Bearer ' [cid=*] (endpoint=/v1/chat/completions (chat)) ```

Confirmed via `tcpdump`: the request never reaches the upstream `api_base`. Upstream logs show only the proxy's own `/health` polling.

## Use case

Routing `openai/*` models to local/internal proxies that ignore auth (e.g. Claudette, lmstudi…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d17h47m4s ago — entered · #import:https:::github.com:berriai:litellm post #3099
The right-hand issue has substantially greater scope and risk: it requires cross-cutting proxy configuration, identity handling, isolation guarantees, and compatibility across multiple storage integrations. The left-hand issue is a localized provider request-path defect with a comparatively small fix and test surface.
#0 of 0 · 31d17h44m13s ago — current · #import:https:::github.com:berriai:litellm post #3148
The left issue is harder because it likely spans configuration parsing, startup initialization, database-backed state, and end-to-end proxy behavior, with broader regression-test coverage. The right issue appears comparatively localized to credential propagation and request-header construction.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search