smol-ai / developer

the first library to let you embed a developer agent in your own app!
https://twitter.com/SmolModels
MIT License
11.76k stars 1.03k forks source link

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

Open ishaan-jaff opened 11 months ago

ishaan-jaff commented 11 months ago

This PR adds support for models from all the above mentioned providers using litellm https://github.com/BerriAI/litellm

TLDR: developer gets:

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)
ishaan-jaff commented 11 months ago

@swyxio @jakubno can you please take a look at this PR when you get the chance ? Happy to add more docs/tests if this initial PR looks good😊

krrishdholakia commented 11 months ago

any updates on this? @swyxio @jakubno

iamjameswalters commented 10 months ago

Very interested in seeing this merged, would be a partial answer to #90

krrishdholakia commented 10 months ago

hey @iamjameswalters any specific providers /models you're trying to use? want to make sure we have it supported - https://docs.litellm.ai/docs/providers

iamjameswalters commented 10 months ago

hey @iamjameswalters any specific providers /models you're trying to use? want to make sure we have it supported - https://docs.litellm.ai/docs/providers

Specifically I'm looking to use Starcoder, which it looks like I can do with litellm through the HuggingFace API. I'm taking this PR for a spin right now to see how it works. 🙂️

ishaan-jaff commented 9 months ago

Hi @swyxio just wanted to follow up on this PR

What was litellm missing to be useful to you? Any feedback here would be helpful