Skip to content

Add support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - using LiteLLM #1112

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions pgml-apps/pgml-chat/pgml_chat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import argparse
from time import time
import openai
import litellm
import signal

import ast
Expand Down Expand Up @@ -120,9 +121,9 @@ async def upsert_documents(folder: str) -> int:
async def generate_response(
messages, openai_api_key, temperature=0.7, max_tokens=256, top_p=0.9
):
openai.api_key = openai_api_key
litellm.api_key = openai_api_key
log.debug("Generating response from OpenAI API: " + str(messages))
response = openai.ChatCompletion.create(
response = litellm.completion(
model="gpt-3.5-turbo",
messages=messages,
temperature=temperature,
Expand Down
1 change: 1 addition & 0 deletions pgml-apps/pgml-chat/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ packages = [{include = "pgml_chat"}]
[tool.poetry.dependencies]
python = ">=3.8,<4.0"
openai = "^0.27.8"
litellm = "^0.11.1"
rich = "^13.4.2"
pgml = "^0.9.0"
python-dotenv = "^1.0.0"
Expand Down