-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add bridge for /chat/completion -> /responses API #11632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…arate folder future work to support completion_to_responses bridge allow calling codex mini via chat completions (and other endpoints)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…n in separate folder" This reverts commit ff87cb8.
write it like a custom llm - requires lesser 'new' components
…and back bridge (non-streaming)
…ses bridge Allows calling codex mini via proxy
maintain <50 LOC
@krrishdholakia Thanks for taking this further! However, it seems something broke in the refactoring: The API Key is no longer used from the configuration but none is sent...
(from the logs) and litellm will respond with:
|
#11668 This fix worked for me. |
Hi @matthid can you share steps to repro your error? |
I sent a completion message to codex-mini-latest with the following proxy config:
Nothing special otherwise. |
@matthid fixed on main 👍 |
@krrishdholakia Further testing revealed that the responses API is a bit more picky about the types: d2db195 Also your fix doesn't work for me since it now complains with:
I actually run into the same and settled into only setting the two properties by hand (not knowing better) |
How are you testing this? @matthid (appreciate your help qa'ing this) |
@krrishdholakia Sure, I'm happy that a basic version is in main ;) Same as before via the same proxy config: The types error happens when you there is an agent message in the chat completion (I use openwebui to test this, so this happens as soon as you continue an existing chat):
The
hence why I used
I'm not sure why we sending all of the stuff to openai, apparently only 16 fields are allowed. |
Thanks @matthid - i'll try to connect to OpenWebUI and test as well |
can i see your full config? curious if there's any other settings i should be adding |
Well the full setup is also quite easy: Logs from local dev env (WSL2)Request ( {
"model": "openai/codex-mini-latest",
"stream": false,
"messages": [
{
"role": "user",
"content": "What are some things to think about?"
}
]
} Logs:
Deployment via docker
Using But to be honest for debugging I just used the config, fired it up in the IDE and sent request via insomnia, pretty basic and reproduced the issue... Full litellm_config
IIRC I'm using drop_params since I head issues somewhere else with openai not allowing the request, not related to this particular feature. |
Interesting - i'm testing claude code which uses Fixing now. |
prevents optional params for responses api from including invalid args / litellm internal information Closes #11632 (comment)
@krrishdholakia cool thanks a lot! Did you also fix the |
prevents optional params for responses api from including invalid args / litellm internal information Closes #11632 (comment)
* refactor(responses/): refactor to move responses_to_completion in separate folder future work to support completion_to_responses bridge allow calling codex mini via chat completions (and other endpoints) * Revert "refactor(responses/): refactor to move responses_to_completion in separate folder" This reverts commit ff87cb8. * feat: initial responses api bridge write it like a custom llm - requires lesser 'new' components * style: add __init__'s and bubble up the responses api bridge * feat(responses/transformation): working sync completion -> responses and back bridge (non-streaming) * feat(responses/): working async (non-streaming) completion <-> responses bridge Allows calling codex mini via proxy * feat(responses/): working sync + async streaming for base model response iterator * fix: reduce function size maintain <50 LOC * fix(main.py): safely handle responses api model check * fix: fix linting errors
prevents optional params for responses api from including invalid args / litellm internal information Closes BerriAI#11632 (comment)
@krrishdholakia Sorry have you seen my last comment? I'm just asking to verify if I can come back to the latest build (instead of my custom version). Thanks! |
Title
Allow calling
/responses
API models vialitellm.completion(..)
Relevant issues
allow calling codex mini via chat completions (and other endpoints)
Builds on #11440 (s/o @matthid)
Closes #9754
Closes #10925
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes