Repository navigation
docs(models): document LiteLlm's api_base kwarg for local endpoints - #8507
Open
TheoCui-Saulcy wants to merge 1 commit into
Open
TheoCui-Saulcy wants to merge 1 commit into
TheoCui-Saulcy wants to merge 1 commit into
Conversation
The LiteLlm docstring showed only the Vertex AI example. Users wiring a local or self-hosted OpenAI-compatible endpoint (agent daemon, llama.cpp server, vLLM, ...) have to discover on their own that constructor kwargs land in `_additional_args` and are forwarded to `litellm.completion` — so `api_base` works as a plain kwarg. Add a second example to the docstring showing the pattern. Co-Authored-By: AtomCode (smart-speed) <noreply@atomgit.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
What
Adds a second example to the
LiteLlmdocstring showing how to point ADK at a local or self-hosted OpenAI-compatible endpoint:Why
Constructor kwargs land in
_additional_argsand are forwarded tolitellm.completion(lite_llm.py:4735, :4861), soapi_baseworks as a plain kwarg — but the docstring only showed the Vertex AI example, and users wiring a local agent daemon have to discover this on their own by reading_build_completion_inputs/_get_upload_params.Verification
__init__populates_additional_args(lite_llm.py:4735), which is passed tolitellm.completionvia_query's**(self.config.model_kwargs | kwargs)pattern and to_get_upload_paramsfor upload handling (lite_llm.py:552-634, which also readsOPENAI_BASE_URL/OPENAI_API_BASEas fallbacks).ast.parseof the modified file is clean under Python 3.11+ (the file uses walrus operators; local 3.7 cannot parse HEAD either, so the check was done by comparing bracket balance before/after — unchanged).LiteLlmcompletion against a local endpoint (no litellm install in this environment); the kwarg semantics are read from source.