Skip to content

Provider SDK ​

LLM providers are adapters in packages/provider-sdk. createDefaultProviderRegistry() in packages/provider-sdk/src/index.ts registers the built-in ones, and every chat model node, agent and /v1 gateway route picks one by its id.

Adapter contract ​

Provider adapters expose:

  • provider definition metadata (id, label, config fields)
  • non-stream generation
  • optional streaming generation
  • tool-call aware response handling

Built-in providers ​

Provider idName in the studioDefault base URLKeyStreaming
echoEcho (built-in demo)none, runs inside L2Mnoneno
ollamaOllamahttp://localhost:11434/v1, or OLLAMA_BASE_URLnoneyes
openai_compatibleOpenAI-Compatiblenone: set the Base URLa stored secret, optionalyes
openaiOpenAI Cloudhttps://api.openai.com/v1a stored secret or OPENAI_API_KEYyes
azure_openaiAzure OpenAInone: your endpoint, or AZURE_OPENAI_ENDPOINTa stored secret or AZURE_OPENAI_API_KEYyes
geminiGeminihttps://generativelanguage.googleapis.com/v1betaa stored secret or GEMINI_API_KEYno
anthropicAnthropic Claudehttps://api.anthropic.com/v1a stored secret or ANTHROPIC_API_KEYno

All of them support tool calls. Echo is a test model: it repeats the prompt back and makes at most one labelled demo tool call, only to a tool L2M classifies read-only (see Build your first MCP agent).

An environment key (OPENAI_API_KEY, ANTHROPIC_API_KEY, AZURE_OPENAI_API_KEY) is only sent to that provider's own endpoint. A node that sets a different base URL needs a stored secret. Keys are always stored as secrets and passed by reference.

Services reachable through the OpenAI-compatible adapter ​

Many hosted services and local servers speak the OpenAI Chat Completions API. Pick OpenAI-Compatible as the provider, set Base URL to the service's base URL below, set Model to one of its model names, and store its key as a secret. L2M sends requests to <Base URL>/chat/completions with the key as a bearer token.

ServiceBase URLSource
Groqhttps://api.groq.com/openai/v1Groq: OpenAI compatibility
Mistralhttps://api.mistral.ai/v1Mistral: migration guides
DeepSeekhttps://api.deepseek.comDeepSeek API docs
Together AIhttps://api.together.ai/v1Together: OpenAI compatibility
OpenRouterhttps://openrouter.ai/api/v1OpenRouter quickstart
vLLM (self-hosted)http://localhost:8000/v1 by defaultvLLM quickstart
LM Studio (local)http://localhost:1234/v1 by defaultLM Studio: OpenAI compatibility

Local servers need no key. With Docker, use host.docker.internal instead of localhost for a server on your machine, for example http://host.docker.internal:1234/v1. Whether tool calls and streaming work depends on the service and the model.

Serving models to other apps: the /v1 gateway ​

The direction can also go the other way. L2M itself serves an OpenAI-compatible API at /v1: apps outside L2M point an OpenAI SDK at https://<your-l2m>/v1 and use an L2M client token as the key. Each public model name is a route to one of the providers above, with budgets, rate limits and content rules applied. See /v1 AI gateway.

Add a new provider ​

  1. Implement the adapter in packages/provider-sdk/src/providers.
  2. Register it in createDefaultProviderRegistry() in packages/provider-sdk/src/index.ts.
  3. Add the provider id to the shared types if needed.
  4. Add its fields to the node config modal.
  5. Add tests beside the adapter.

A service that already speaks the OpenAI API needs no new adapter: use OpenAI-Compatible.

This website (not the L2M product) counts page views with GoatCounter, without cookies.