eunomia-bpf / GPTtrace

Generate eBPF programs and tracing with ChatGPT
https://eunomia.dev/GPTtrace/
MIT License
217 stars 21 forks source link

Add support for Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm #14

Closed ishaan-jaff closed 11 months ago

ishaan-jaff commented 1 year ago

Pull Request Template

Description

Add support for Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. I'm the maintainer of litellm https://github.com/BerriAI/litellm - a simple & light package to call OpenAI, Azure, Cohere, Anthropic, Replicate API Endpoints

This PR adds support for models from all the above mentioned providers (by creating a class liteLLMChatGPTBot)

Here's a sample of how it's used:

from litellm import completion

## set ENV variables
# ENV variables can be set in .env file, too. Example in .env.example
os.environ["OPENAI_API_KEY"] = "openai key"
os.environ["COHERE_API_KEY"] = "cohere key"

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)

# cohere call
response = completion("command-nightly", messages)

# anthropic call
response = completion(model="claude-instant-1", messages=messages)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

Checklist

ishaan-jaff commented 1 year ago

@Officeyutong @try-agaaain if this initial PR looks good - I'd love to add tests, documentation on using this. Would love your feedback on the same

yunwei37 commented 1 year ago

Thank you very much! It looks nice, and please add more tests for it : )

yunwei37 commented 11 months ago

Thanks : )