@runbit/openai
v0.1.1
Published
An OpenAI-backed `ChatModel` for Runbit. Zero dependencies — uses global `fetch`.
Readme
@runbit/openai
An OpenAI-backed ChatModel for Runbit. Zero dependencies — uses global fetch.
npm install @runbit/openai @runbit/runtimeimport { openai } from "@runbit/openai";
import { agent } from "@runbit/runtime";
const model = openai("gpt-4o-mini"); // reads OPENAI_API_KEY
const assistant = agent({ model, tools: [weather] });Options
openai("gpt-4o-mini", {
apiKey: process.env.OPENAI_API_KEY, // default
baseURL: "https://api.openai.com/v1", // point at any OpenAI-compatible API
temperature: 0.7,
maxTokens: 1024,
});Supports tool calling and reports token usage (so @runbit/devtools can show cost). Pass the result straight to agent({ model }).
Part of Runbit — the AI Runtime. Everything executes through one small, event-driven runtime; agents, workflows, RAG, and observability are packages on top.
- Umbrella:
@runbit/runtime - License: MIT
