continue-custom/packages/openai-adapters
2024-12-11 10:31:49 -08:00
..
src export comment 2024-12-10 12:52:36 -08:00
test Add Scaleway as OpenAI compatible LLM and Embeddings provider 2024-12-10 17:22:50 +01:00
.npmignore OpenAI Adapters (#1859) 2024-07-28 18:22:37 -07:00
jest.config.mjs Convert core/ to NodeNext (#1877) 2024-07-30 19:04:30 -07:00
package-lock.json use openai adapters in BaseLLM 2024-12-08 09:27:12 -08:00
package.json update packages 2024-12-09 08:56:01 -08:00
README.md update mcp docs for multiple servers 2024-12-11 10:31:49 -08:00
tsconfig.json More OpenAI Adapters (#1875) 2024-07-30 13:05:24 -07:00

OpenAI Adapters

OpenAI adapters convert an OpenAI-compatible request to a request for another API and back.

They are purely a translation layer, and are not concerned with:

  • Templates
  • Whether a model supports tools, images, etc.
  • Dynamically changing API base for model
  • Keeping track of system message (it will always be the first message with a systemMesage)
  • Keeping a private variable with anything that is already passed through the OpenAI request body
  • Appending "/" to the apiBase (but this is TODO)
  • Batching embeddings (yes, it requires some knowledge of max batch size, but it's more important to maintain 1 req = 1 req)
  • Using streamChat for streamComplete and vice-versa if one isn't defined

The goal is for this to change as infrequently as possible. It should only require updating when the actual API format changes.

They are concerned with:

  • Converting model aliases
  • Cache behavior
  • max stop words
  • use legacy completions endpoint?
  • anything else that couldn't possibly be guess by the client since it won't know the endpoint behind the proxy

Supported APIs

  • Anthropic
  • AskSage
  • Azure
  • Bedrock
  • Bedrock Import
  • Cerebras
  • Cloudflare
  • Cohere
  • DeepInfra
  • Deepseek
  • Flowise
  • Function Network
  • Gemini
  • Groq
  • HuggingFace Inference API
  • HuggingFace TGI
  • Kindo
  • LMStudio
  • LlamaCpp
  • Llamafile
  • Msty
  • Mistral
  • Nvidia
  • Nebius
  • OpenRouter
  • OpenAI
  • !Ollama
  • Replicate
  • SageMaker
  • SambaNova
  • Scaleway
  • Silicon Flow
  • TextGen Web UI
  • Together
  • Vllm
  • Vertex AI
  • Voyage AI
  • WatsonX
  • xAI
  • Fireworks
  • Moonshot