Implement LiteLLM integration for OpenAI-compatible /v1/chat/completions
- Add litellm to requirements.txt - Add --parser CLI arg (auto/litellm, default auto) - Create codai/litellm_backend.py module with: - LiteLLMBackend class for standardized responses - Rate limit headers (x-ratelimit-remaining-tokens, x-ratelimit-limit-tokens) - Qwen tool-call resilience (parse <tool> and <tool_call> tags) - Error handling with litellm exception mapping - Update chat completions endpoint to use litellm when --parser litellm - Update codai/__init__.py to export litellm components
Showing
codai/litellm_backend.py
0 → 100644
Please
register
or
sign in
to comment