Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple LLMs through Litellm #222

Open
5 tasks
dhirenmathur opened this issue Jan 9, 2025 · 11 comments
Open
5 tasks

Support multiple LLMs through Litellm #222

dhirenmathur opened this issue Jan 9, 2025 · 11 comments
Assignees

Comments

@dhirenmathur
Copy link
Contributor

dhirenmathur commented Jan 9, 2025

Replace LangChain Chat Clients with LiteLLM

Objective

Replace all LangChain chat client implementations with LiteLLM while maintaining existing functionality.
APIs to manage user's LLM choice and keys and ensure that right LLM is selected during processing and agent execution.

Requirements

  • Keep existing provider service pattern intact
  • Support all current LLMs through LiteLLM
  • Maintain inference and agent interaction functionality
  • Remove CrewAI specialized handling (This was added because crewai was not able to support anthropic through the langchain client due to some conflict witht their internal litellm)
  • Preserve streaming functionality

Implementation

  1. Replace LangChain imports with LiteLLM
  2. Update provider services
  3. Remove CrewAI-client specific code
  4. Update configurations and environment variables

Testing

  • Verify provider service functionality
  • Test all LLM integrations
  • Validate inference and agent operations
  • Check streaming implementations
  • Run existing test suite

Success Criteria

  • All LangChain chat clients replaced
  • Potpie supports any model that is supported by Litellm
  • User is able to set preference and keys for their LLM of choice
  • No breaks in existing functionality
  • Streaming working as expected
@dhirenmathur
Copy link
Contributor Author

Need to think about how to select the correct provider, model and key

@dhirenmathur
Copy link
Contributor Author

/bounty 10

Copy link

algora-pbc bot commented Jan 9, 2025

💎 $50 bounty • potpie.ai

Steps to solve:

  1. Start working: Comment /attempt #222 with your implementation plan
  2. Submit work: Create a pull request including /claim #222 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to potpie-ai/potpie!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @dfordp Jan 14, 2025, 12:44:55 PM WIP
🟢 @PRANJALRANA11 Jan 20, 2025, 3:04:12 PM WIP

@dhirenmathur
Copy link
Contributor Author

/bounty 50

@dhirenmathur dhirenmathur changed the title Migrate to Litellm for multi LLM support Support multiple LLMs through Litellm Jan 9, 2025
@dfordp
Copy link

dfordp commented Jan 14, 2025

/attempt #222

1 similar comment
@PRANJALRANA11
Copy link

PRANJALRANA11 commented Jan 20, 2025

/attempt #222

@PRANJALRANA11
Copy link

@dhirenmathur does we have to support all llm with litellm or the llm which are present in current application for those just we have to change from langchain to lite

@PRANJALRANA11
Copy link

and also does i have to completely remove langchain in all aspects like - prompttemplates , tool calls or just the chat

@dhirenmathur
Copy link
Contributor Author

hey @PRANJALRANA11 we want to incorporate litellm across the app so that we can support all LLMs. We use instances of langchain client and the crewai client, this makes the provider_service and agent code really messy, ideally we want to replace both with a single litellm instance.

Yes if we are not going to use the langchain client then it does not make sense to keep the prompt template etc.

For tools, I think we can continue with langchain tools, what do you think?

@dhirenmathur
Copy link
Contributor Author

Hey @dfordp , Thanks for attempting this! In the interest of time, I'm assigning this to @PRANJALRANA11 since there have been no follow up messages in ~10 days. We will have other open issues for you to contribute on when you're ready!

@dfordp
Copy link

dfordp commented Jan 23, 2025

@dhirenmathur sorry I wasn't able to do it, I was 50% through to doing it but got busy with work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants