Skip to content

[BUG] compression_first_stage always times out (30s) on Python 3.14 + headroom-ai 0.25.0 incompatible with Python 3.14 (litellm dep) #956

Description

@aditya-nawal

Environment

  • headroom-ai: 0.24.0
  • Python: 3.14 (Windows 11)
  • Claude Code via ANTHROPIC_BASE_URL proxy
  • Install method: pip install --no-build-isolation (required to bypass puccinialin cache issue)

Bug 1: compression_first_stage always times out
Every single API request shows:
compression_first_stage: ~30,010ms (always exactly the timeout)
Optimization failed: TimeoutError: (no detail)
transforms_applied: []
tokens_saved: 0

Stage timings from proxy.log:
{"compression_first_stage": 30010.916, "total_pre_upstream": 30021.483}

This happens on ALL requests regardless of size (tested with 895KB payloads).
MCP compress returns transforms: ["router:noop"] — also not compressing.

Suspect: PyO3 Rust extension is blocking the asyncio event loop on Python 3.14
due to async/GIL changes. PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 was used for install.

Bug 2: headroom-ai 0.25.0 cannot be installed on Python 3.14
litellm>=1.86.2 (required by 0.25.0) has Requires-Python >=3.10,<3.14
ERROR: Could not find a version that satisfies the requirement litellm<2.0,>=1.86.2

What works:

  • Proxy routing: ✓ (all API calls proxied)
  • Prefix cache alignment: ✓ ($171 savings observed)
  • MCP server: ✓ (connected, headroom_stats returns data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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