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

add support for claude, azure, cohere, replicate #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions datachad/backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import streamlit as st
import tiktoken
import litellm
from litellm import completion
from langchain.base_language import BaseLanguageModel
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.chat_models import ChatOpenAI
Expand Down Expand Up @@ -81,6 +83,13 @@ def get_model(options: dict, credentials: dict) -> BaseLanguageModel:
verbose=True,
callbacks=[StreamingStdOutCallbackHandler()],
)
case *litellm.model_list:
model = ChatOpenAI(
model_name=options["model"].name,
temperature=options["temperature"],
openai_api_key=credentials["openai_api_key"],
client=completion
)
# Added models need to be cased here
case _default:
msg = f"Model {options['model'].name} not supported!"
Expand Down