Skip to content

Proposal: Replacing LangChain with LiteLLM #1418

@dlqqq

Description

@dlqqq

Problem

There are several issues with using langchain as the model library of choice in JAI:

This issue proposes a solution to #1312.

Proposed Solution

We propose that Jupyter AI migrates to use litellm instead of langchain as a model library to provide universal LLM support.

litellm offers a much more simple dependency tree and is noticeably faster to import. It also provides access to a vast array of models out-of-the-box, without the need for partner packages. This entirely solves 3 major issues in JAI v2:

  1. Dealing with provider dependencies: litellm provides everything out-of-the-box.
  2. Forcing users to wait for us to update the list of models regularly for each provider: litellm maintains its own lists.
  3. Forcing developers to create a package to add a model via entry points API: litellm supports custom models

As Jupyter AI v3 will only provide Jupyternaut, the requirement on langchain can be dropped if this proposal is accepted. For models that are not available through our litellm implementation, developers can write custom personas. These are easy to write and can be defined in any .jupyter/ directory.

Additional context

Also would fix #1308.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions