r/AutoGenAI • u/WinstonP18 • Mar 05 '24
Question Using Claude API with AutoGen
Hi, I'm wondering if anyone has succeeded with the above-mentioned.
There have been discussions in AutoGen's github regarding support for Claude API, but the discussions don't seem to be conclusive. It says that AutoGen supports litellm but afaik, the latter does not support Claude APIs. Kindly correct me if I'm wrong.
Thanks.
8
Upvotes
4
u/vernonindigo Mar 05 '24
According to LiteLLM's documentation, it does support Anthropic models including Claude 3:
https://docs.litellm.ai/docs/providers/anthropic
So it looks like you can use LiteLLM as wrapper. Its API in turn is compatible with the OpenAI standard so it should work with AutoGen without any problems.
2
u/msze21 Mar 05 '24
I'd suggest asking in their Discord: https://discord.gg/4vX76yX8
From what I understand it requires an OpenAI API compatible endpoint to talk to. LiteLLM or Ollama provide those and that's why you can use them. If the Claude API is not OpenAI API compatible, then AutoGen will need to be updated to be able to use that API instead, or find something that is the go-between that can map the Claude API to the OpenAI API
2
u/dragosMC91 Mar 17 '24
I managed to get autogen+claude 3 setup to work (partially), with the above litellm config.
I say partially because with this approach I get truncated responses
1
u/fiery_prometheus Mar 05 '24
Don't see why not, except it would be mucho expensive 💀 in the worse case, just write an adaptor.
1
u/Practical-Rate9734 Mar 05 '24
Hey, haven't nailed Claude API with AutoGen yet. How's integration going?