feat: add LiteLLM as an LLM provider - #130
Open
RheagalFire wants to merge 1 commit into
Open
Conversation
Add LiteLLM AI gateway integration supporting 100+ LLM providers through a single interface. Users can switch by setting OPENTALKING_LLM_PROVIDER=litellm.
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.
Summary
Add LiteLLM as an LLM provider, giving OpenTalking access to 100+ LLM providers (OpenAI, Anthropic, Google, Bedrock, Azure, Ollama, etc.) through a single interface.
Set
OPENTALKING_LLM_PROVIDER=litellmand use LiteLLM model format inOPENTALKING_LLM_MODEL:Changes:
opentalking/providers/llm/litellm_chat/provider withLiteLLMChatClientimplementingchat_stream()vialitellm.acompletion(stream=True, drop_params=True)opentalking/providers/llm/factory.pywithcreate_llm_client()factory dispatching onllm_providerconfigpip install opentalking[litellm]Backward compatible - defaults to
openai_compatiblewhenOPENTALKING_LLM_PROVIDERis unset.Validation
ruff check src/opentalking/core src/opentalking/server src/opentalking/worker src/opentalking/llm src/opentalking/tts src/opentalking/avatars src/opentalking/events src/opentalking/rtc apps/api apps/unified apps/cli testsmypy src/opentalking/core src/opentalking/server src/opentalking/worker src/opentalking/llm src/opentalking/tts src/opentalking/avatars src/opentalking/events src/opentalking/rtc apps/api apps/unified apps/cli --ignore-missing-importspytest apps/api/tests apps/worker/tests testscd apps/web && npm run buildNotes
litellmis an optional dependency (pip install opentalking[litellm]) - no impact on existing installationsOPENTALKING_LLM_BASE_URL(unlikeopenai_compatible), since LiteLLM routes via the model identifier prefix (e.g.anthropic/claude-sonnet-4-6)drop_params=Trueenabled by default to handle per-provider parameter differences