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

Anthropic Claude? #310

Open
nedtwigg opened this issue Mar 4, 2024 · 3 comments
Open

Anthropic Claude? #310

nedtwigg opened this issue Mar 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@nedtwigg
Copy link

nedtwigg commented Mar 4, 2024

Feature Description

It would be neat if this library could talk to Anthropic Claude.

Problem it Solves

The new Claude 3 models are impressive, and have an API very similar to OpenAI.

Proposed Solution

Make it possible to chat with Anthropic Claude models.

Additional Context

I think it's great this library is not langchain. I don't want a high-level abstraction, just to pipe this low-level abstraction into another LLM provider.

@nedtwigg nedtwigg added the enhancement New feature or request label Mar 4, 2024
@nedtwigg
Copy link
Author

I've been tinkering with Anthropic Haiku just in their playground, and for a lot of our evals it's actually doing better than GPT-4-turbo, it's 40x cheaper on input tokens, 20x cheaper on output, and subjectively way way way faster.

@aallam
Copy link
Owner

aallam commented Apr 1, 2024

This is interesting indeed. I will take a look at it :)

@AndraxDev
Copy link
Contributor

For Claude you can use the following config:

val configOpenAI = OpenAIConfig(
    // API key and other params
    // ...
    host = OpenAIHost("https://openrouter.ai/api/v1/"),
)

// ...

val chatCompletionRequest = ChatCompletionRequest(
    // Other params and messages
    // ...
    model = ModelId("anthropic/claude-3-opus"),
    // or anthropic/claude-3-sonnet or anthropic/claude-3-haiku
)

// Perform completion request...

Streaming output is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants