openaiCompatible

openaiCompatible

Any OpenAI-compatible endpoint (Your own LLM). Its key, when it needs one, is AGENT_LLM_API_KEY, else OPENAI_API_KEY.

import { openaiCompatible } from "curb/providers";

openaiCompatible(options: OpenaiCompatibleOptions): LlmDescriptor;

Options

OptionTypeWhat it does
baseURLstringThe endpoint, like http://127.0.0.1:11434/v1. Required
modelstringRequired
reasoningEffort"none", "minimal", "low", "medium", "high", "xhigh", "max"Sent as reasoning_effort. "none" switches thinking off where the endpoint takes it
temperaturenumber, 0 to 2Sent as temperature
topPnumber, above 0, at most 1Sent as top_p
bodyobjectExtra request fields, sent as written. A field Curb or an option above sets is refused

Unset, each one is the endpoint’s default.

Example

<Agent llm={openaiCompatible({ baseURL: "http://127.0.0.1:11434/v1", model: "llama3.3", temperature: 0.2 })} />

Version history

VersionChanges
v1.7.2reasoningEffort, temperature, topP and body added
v1.2.6openaiCompatible introduced