Repository navigation
Conversation
Contributor
Author
|
This can be reviewed and merged. I inspected some examples and everything seems to check out. |
Contributor
Author
|
I will rebase this on |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #821
This PR migrates
handlers.llmfromlitellmtoany-llm, as suggested in #821, removinglitellmentirely as a dependency. For the most part it's a seamless migration becauseany-llmis designed for exactly this.There is one annoying but important edge case which
litellmhandled butany-llmdoes not: OpenAI's first-party Completion API (viaany_llm.completion) does not support reasoning when there are tools in the mix; OpenAI want you to use their Responses API instead (viaany_llm.responses). This breaks uniform model access throughany_llm.completionfor OpenAI models.The path of least resistance is to do what
litellm.completionalready does, which is recognize those models and translate thecompletioncall to an equivalentresponsescall. Theany-llmdevelopers have said they have no plans to do this themselves, so it has to live in our code as a bunch of private helper functions inhandlers.llm.harness.provision.any_llm.Apart from this, the diff is mostly just boilerplate accounting for small API and behavior changes from the migration.
I think this PR is almost complete but it is a large breaking change and mostly LLM-authored so I want to run all the examples end-to-end and examine the outputs myself to make sure there are no subtle regressions I've missed, e.g. in the integration with langfuse.