Skip to content

feat(backend): integrate LiteLLM API Backend#564

Merged
you-n-g merged 35 commits into
mainfrom
litellm_backend
Feb 13, 2025
Merged

feat(backend): integrate LiteLLM API Backend#564
you-n-g merged 35 commits into
mainfrom
litellm_backend

Conversation

@YeewahChan

@YeewahChan YeewahChan commented Feb 8, 2025

Copy link
Copy Markdown
Contributor

Description

Integration of LiteLLM API Backend:

  • Added LiteLLMAPIBackend class implementing the APIBackend interface with methods for building chat sessions, creating embeddings, and calculating token counts. (rdagent/oai/backend/litellm_backend.py)
  • Updated LLMSettings to include configuration options for LiteLLM chat and embedding models. (rdagent/oai/llm_conf.py)
  • Imported LiteLLMAPIBackend and DeprecBackend in the __init__.py file of the backend module. (rdagent/oai/backend/__init__.py)

Test Cases for LiteLLM Backend:

  • Added unit tests for chat completion and embeddings using the LiteLLM backend. (test/litellm_backend/test_completion.py, test/litellm_backend/test_embedding_and_similarity.py)

Motivation and Context

These changes are required to integrate a new LiteLLM API backend, which will provide improved language model support issue #504 . The updates to task loading and benchmarking functionalities, along with the new test cases, ensure that the project remains robust and reliable.

How Has This Been Tested?

  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Your own tests:
    test completion:
    image
    test embedding and similarity:
    image

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

📚 Documentation preview 📚: https://RDAgent--564.org.readthedocs.build/en/564/

Comment thread rdagent/oai/backend/litellm_backend.py Outdated
Comment thread rdagent/oai/backend/litellm_backend.py Outdated
Comment thread rdagent/oai/backend/litellm_backend.py Outdated
Comment thread rdagent/oai/backend/litellm_backend.py Outdated
Comment thread rdagent/oai/backend/litellm_backend.py Outdated
Comment thread .gitignore Outdated
Comment thread rdagent/oai/llm_conf.py Outdated
Comment thread rdagent/oai/llm_conf.py Outdated
@you-n-g you-n-g merged commit f477687 into main Feb 13, 2025
@you-n-g you-n-g deleted the litellm_backend branch February 13, 2025 07:16
Jensen246 pushed a commit to Jensen246/RD-Agent that referenced this pull request Jun 6, 2025
* File structure for supporting litellm

* more litellm support

* feat: Add CachedAPIBackend class and dynamic API backend retrieval function

* fix: update benchmark folder path and add default values for architecture and hyperparameters

* feat: add LiteLLMAPIBackend and DeprecBackend ; changed structure of the project ; with bus

* fix : deprec_backend

* feat: Add LiteLLMAPIBackend class and related features; update configuration and test cases.

* feat: Enhance LiteLLMAPIBackend with encoder support and dynamic argument handling;Enhance log Colors

* lint

* fix lint...

* fix: Lint

* fix:make auto-lint

* fix:test oai

* fix:redundant _abckend.py

* fix: Optimize LiteLLMAPIBackend on token counting functiona, and clean up unused code;add test on this function

* feat: Add LiteLLMSettings class and update model settings usage

* fix: Update LiteLLMSettings environment variable prefix and model configurations

* fix : gitignore

* test: Consolidate and relocate test files for litellm backend and oai

* fix : lint

* fix: lint

* auto lint

* lint

* LINT

* lint

* chore: remove deprecated backend configuration comments

* refactor: Remove unused functions and imports from deprec.py and llm_utils.py

* refactor: Move md5_hash function from deprec.py to llm_utils.py

* chore: Remove extra newline and add missing import in deprec.py

* lint

* refactor: Move md5_hash function to utils module

* lint

* lint

* lint

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: Yihua Chen <v-yihuachen@microsoft.com>
licong01-cloud pushed a commit to licong01-cloud/RD-Agent that referenced this pull request Dec 13, 2025
* File structure for supporting litellm

* more litellm support

* feat: Add CachedAPIBackend class and dynamic API backend retrieval function

* fix: update benchmark folder path and add default values for architecture and hyperparameters

* feat: add LiteLLMAPIBackend and DeprecBackend ; changed structure of the project ; with bus

* fix : deprec_backend

* feat: Add LiteLLMAPIBackend class and related features; update configuration and test cases.

* feat: Enhance LiteLLMAPIBackend with encoder support and dynamic argument handling;Enhance log Colors

* lint

* fix lint...

* fix: Lint

* fix:make auto-lint

* fix:test oai

* fix:redundant _abckend.py

* fix: Optimize LiteLLMAPIBackend on token counting functiona, and clean up unused code;add test on this function

* feat: Add LiteLLMSettings class and update model settings usage

* fix: Update LiteLLMSettings environment variable prefix and model configurations

* fix : gitignore

* test: Consolidate and relocate test files for litellm backend and oai

* fix : lint

* fix: lint

* auto lint

* lint

* LINT

* lint

* chore: remove deprecated backend configuration comments

* refactor: Remove unused functions and imports from deprec.py and llm_utils.py

* refactor: Move md5_hash function from deprec.py to llm_utils.py

* chore: Remove extra newline and add missing import in deprec.py

* lint

* refactor: Move md5_hash function to utils module

* lint

* lint

* lint

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: Yihua Chen <v-yihuachen@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants