Skip to content

Conversation

@qdrddr
Copy link

@qdrddr qdrddr commented Nov 17, 2025

  • Add new LiteLLMProvider class using pydantic-ai's native LiteLLMProvider
  • Register litellm_proxy provider in PROVIDER_REGISTRY
  • Support OpenAI-compatible API endpoints via LiteLLM proxy
  • Enable use of multiple LLM providers through a unified proxy interface

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @qdrddr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates LiteLLM as a new model provider, allowing the system to connect to a wider array of large language models through a standardized, OpenAI-compatible interface. This enhancement simplifies the process of switching between or utilizing multiple LLM services, improving the system's flexibility and extensibility.

Highlights

  • New LiteLLM Provider: Introduced a new LiteLLMProvider class that leverages pydantic-ai's native LiteLLM integration to support various LLMs through a unified proxy.
  • Provider Registration: The new litellm_proxy provider is conditionally registered in the central PROVIDER_REGISTRY, making it available for use if LiteLLM is installed.
  • Unified LLM Access: Enables the system to interact with multiple LLM providers via an OpenAI-compatible API endpoint, facilitated by the LiteLLM proxy.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@qdrddr qdrddr force-pushed the add-litellm-proxy-provider branch from 54f1597 to 5096773 Compare November 17, 2025 16:01
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for LiteLLM as a provider, allowing the use of various LLM backends through a unified proxy interface. The implementation includes a new LiteLLMProvider class and dynamically registers it. The changes are well-structured. My main feedback is to improve the robustness of the new provider by adding a health check to validate that the LiteLLM proxy is running, similar to how the OllamaProvider is handled. This will provide better error messages to users.

- Add new LiteLLMProvider class using pydantic-ai's native LiteLLMProvider
- Register litellm_proxy provider in PROVIDER_REGISTRY
- Support OpenAI-compatible API endpoints via LiteLLM proxy
- Enable use of multiple LLM providers through a unified proxy interface
- Upgrade pydantic-ai-slim to 1.0.1 (required for LiteLLM provider support)
- Add check_litellm_proxy_running helper for robust proxy validation
- Validate proxy is running before creating models (consistent with OllamaProvider)
- Upgrade pydantic-ai-slim to 1.18.0 which includes LiteLLM provider support
- Fix circular import in providers/base.py by moving LiteLLM import after registry definition
- Fix circular import in providers/litellm.py by using local import for check_litellm_proxy_running
- Add debug logging when LiteLLM provider is not available
@qdrddr qdrddr mentioned this pull request Nov 18, 2025
Copy link
Owner

@vitali87 vitali87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! One minor issue:

The .env.example adds "Example 5" but one already exists at line 39 ("Example 5: Mixed - OpenAI orchestrator + Google cypher"). Should be "Example 6".

@vitali87
Copy link
Owner

@qdrddr please address the minor issue I mentioned and resolve the merge conflict to get this into master.

Thanks

@qdrddr
Copy link
Author

qdrddr commented Dec 27, 2025

@vitali87 .env.example is fixed

Copy link
Owner

@vitali87 vitali87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

Same situation as PR #162 - I've recently refactored to centralize strings and enforce stricter coding standards. This PR needs adjustments to align with CONTRIBUTING.md.

Question: The codebase now uses pydantic-ai>=1.27.0. Does the LiteLLM provider API still work the same way? Please verify compatibility after rebasing.

Option 1: You address:

  • Rebase on latest main
  • Verify LiteLLM API compatibility with pydantic-ai 1.27.0
  • Remove docstrings (module, functions)
  • Move log message to logs.py
  • Install pre-commit hooks: pre-commit install

Option 2: I can make these adjustments myself and merge, with attribution to you.

Let me know which option you'd prefer!

@vitali87 vitali87 mentioned this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants