mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
Fixes from two independent reviews of the provider addition: * `main.py`: drop the provider's own `logging.post_call`. The shared `BaseLLMHTTPHandler` already logs post-call, so this double-fired callbacks and overwrote raw-response metadata; on the async path `response` is still a coroutine there, so callbacks ran before the request completed. Also adopt the `Final` annotations and `_dispatch_client_http(ctx)` used by the sibling `_complete_*` blocks. * `transformation.py`: `json.dumps(..., ensure_ascii=False)` when rebuilding the unwrapped body -- the default escapes non-ASCII to `\uXXXX`, and `OpenAIGPTConfig.transform_response` hands `raw_response.text` straight to `logging.post_call`, so observability backends received mangled text. * `transformation.py`: remove two unreachable branches. `httpx.StreamError` cannot arrive, because `BaseLLMHTTPHandler` returns `get_model_response_iterator()` without calling `transform_response` when streaming (the only paths that do call it set `stream=False`, so the body is fully buffered). The `max_completion_tokens` fallback cannot fire either, because `request_data` is the post-`map_openai_params` payload and the mapping has already rewritten that key to `max_tokens`. * `transformation.py`: modernise typing to builtin generics and PEP 604 unions, matching the repo's UP006/UP007/UP035/UP045 rules and the CometAPI house style. * UI: add `CLINEPASS` to the `Providers` enum and `provider_map`. `CredentialModal` builds its options from `Object.entries(Providers)`, so backend credential metadata alone left the provider unselectable. * README: add the provider table row, ticking only the endpoints `provider_endpoints_support.json` declares. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| litellm-dashboard | ||
| Dockerfile | ||
| nginx.conf | ||