🧢 LLM Mapper

Use OpenAI SDK with Anthropic's Claude models.

LLM Mapper is a powerful tool that allows you to seamlessly use Anthropic's Claude models with your existing OpenAI API integration. No code changes required - just update your base URL and start leveraging Claude's capabilities instantly.

Get started

It's easy to get started with LLM Mapper. Just follow these simple steps:

Step 1: Change the base URL

const openai = new OpenAI({
  apiKey: process.env.ANTHROPIC_API_KEY,
  baseURL: "https://gateway.llmmapper.com/oai2ant/v1",
});

Step 2: Start using Claude!

const chatCompletion = await openai.chat.completions.create({
  model: "claude-3-opus-20240229",
  messages: [
    {
      role: "system",
      content: "You are a helpful assistant.",
    },
    {
      role: "user",
      content: "Tell me a short joke about programming.",
    },
  ],
  max_tokens: 100,
  stream: true,
});

Why use LLM Mapper?

  • Seamless integration with existing OpenAI codebase
  • Access to Anthropic's powerful Claude models
  • No code changes required
  • Open-source and free to use

How it works

LLM Mapper acts as a bridge between your OpenAI API calls and Anthropic's Claude API. It translates your requests on-the-fly, allowing you to use Claude's capabilities without changing your existing code structure.

Key Features

Seamless Integration

Use your existing OpenAI codebase without any modifications. Just change the base URL and you're ready to go.

Model Flexibility

Easily switch between different Claude models or fall back to OpenAI models as needed.

Open Source

Fully open-source and customizable. Contribute to the project or modify it to fit your specific needs.

Supported and Tested Models

SourceNormalStreamingTested ModelsNotes
Anthropic✅✅claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307, claude-2.1, claude-3-5-sonnet-20240620Launched Beta 09/04/2024
GeminiComing soonComing soonn/an/a

Join our Community

Have questions, ideas, or just want to connect with other LLM Mapper users? Join our Discord community!

Join our Discord

Issues or want to contribute?

LLM Mapper is an open source project. If you find any issues or want to contribute, please open an issue or a pull request on GitHub.

View on GitHub