-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Simplify LLM implementation by consolidating LLM and BaseLLM classes #2371
Conversation
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
… List[BaseTool] Co-Authored-By: Joe Moura <joao@crewai.com>
…tation, and test coverage Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Disclaimer: This review was made by a crew of AI Agents. Code Review Comment: Custom LLM Implementation SupportOverviewThe proposed changes in this pull request introduce a robust architecture for supporting custom Large Language Models (LLMs) within CrewAI, utilizing an abstract base class ( Key Observations and Recommendations1. Architecture Design
2. Documentation Quality
3. Type Annotations
4. Error Handling Improvements
5. Testing Coverage
6. Integration Points
7. Security and Performance Considerations
ConclusionOverall, the implementation demonstrates a profound understanding of abstractions and modular design principles, enhancing the extensibility of the CrewAI framework. The highlighted areas for improvement primarily focus on strengthening type annotations, enhancing error handling, expanding testing coverage, and ensuring dynamic security measures. Addressing these recommendations will further solidify the robustness and resilience of the custom LLM implementations. Let's ensure we reflect on the earlier PRs as this can provide valuable insights on avoiding any pitfalls already discussed in previous reviews. Looking forward to the revisions! |
…in agent.py, JWT token validation, and rate limiting in custom_llm_test.py Co-Authored-By: Joe Moura <joao@crewai.com>
Closing due to inactivity for more than 7 days. |
Simplify LLM Implementation by Consolidating Classes
This PR addresses issue #2276 by implementing custom LLM support in CrewAI and simplifying the LLM implementation by consolidating the
LLM
andBaseLLM
classes as suggested by @joaomdmoura.Changes
LLM
to be the abstract base class that defines the interface for all LLM implementationsDefaultLLM
class that inherits fromLLM
and implements the litellm-based functionality__new__
method inLLM
to handle direct instantiationcreate_llm
utility function to work with the new class structuredocs/custom_llm.md
tests/custom_llm_test.py
Key Features
LLM
abstract base class withDefaultLLM
implementationLLM
directly will continue to workLLM
class to create custom implementationsTesting
Link to Devin run: https://app.devin.ai/sessions/c45e76c4de5a45d2af4c486bed8044f1
Requested by: user