Skip to content

Migrate to LiteLLM #100

@barun-saha

Description

@barun-saha

SlideDeck AI supports several LLMs from different providers via LangChain. This requires a different LangChain package to be installed for each provider.

The proposal is to introduce LiteLLM as a replacement. On one hand, it will provide a uniform API to access all LLMs, reducing code footprint. On the other hand, the software dependencies and build times will also decrease.

Addressing this issue requires to look at the following parts:

  • helpers/llm_helper.py: All LLM-related code can be found here. The functions should be replaced with a single function that uses LiteLLM.
  • app.py: Here, StreamlitChatMessageHistory, HumanMessage, and ChatPromptTemplate components depend on LangChain. The last one is easy to replace, use string .format(). For HumanMessage, the role of the message is to be checked. The key challenge would be to implement something like StreamlitChatMessageHistory and add/update/delete from it when required.

The changes should be tested in a freshly created environment with no LangChain installed. Also, need to make sure that the LiteLLM integration with Ollama is also working (for offline models).

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions