Integrate litellm for multi-provider LLM support#168
Integrate litellm for multi-provider LLM support#168KylinMountain merged 14 commits intoVectifyAI:mainfrom
Conversation
…remove unused llm_complete_stream
Code reviewFound 1 issue:
PageIndex/pageindex/page_index.py Lines 501 to 503 in 847782c PageIndex/pageindex/page_index.py Lines 734 to 736 in 847782c 🤖 Generated with Claude Code If this code review was useful, please react with 👍. Otherwise, react with 👎. |
resolved |
|
you can try using another llm provider like anthropic like this with env ANTHROPIC_API_KEY. |
Code reviewFound 5 issues:
Lines 381 to 391 in 6bda6e7
Lines 1 to 2 in 6bda6e7
Lines 58 to 77 in 6bda6e7
Lines 501 to 510 in 6bda6e7
PageIndex/pageindex/page_index.py Lines 302 to 326 in 6bda6e7 - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Pass opt.model to get_page_tokens so tokenization respects the configured model instead of always using gpt-4o-2024-11-20. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
openai is no longer directly imported; it comes in as a transitive dependency of litellm. Pinning it explicitly risks version conflicts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
litellm==1.82.0 and openai-agents have conflicting openai version requirements, but openai==1.101.0 works at runtime for both. The pin is necessary to prevent litellm from pulling in openai>=2.x which would break openai-agents. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
openai is not directly used; it comes in as a transitive dependency of litellm. No openai-agents in this branch so no pin needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
resolved |
Summary
openai+tiktokenwithlitellmfor unified multi-provider LLM support (OpenAI, Azure, Gemini, etc.)ChatGPT_API→llm_completion,ChatGPT_API_async→llm_acompletion(usinglitellm.acompletionfor native async).CHATGPT_API_KEYauto-aliased toOPENAI_API_KEYtiktokendependency; uselitellm.token_counterinsteadTest plan
OPENAI_API_KEYand run existing PDF indexing — should behave identically to beforeCHATGPT_API_KEY(legacy) — should still work via aliasgemini/gemini-pro) by setting the appropriate env var🤖 Generated with Claude Code