Skip to content

Local runtime · See your AI. Build with it.

Your own apps can call the models you already pay for.

OriginLM is one local runtime that makes the AI already on your machine callable from software you build. One integration, instead of client-specific paths, metadata parsers and streaming protocols for every AI client.

npm install originlm@alpha
01 · Installed agentsExample machine
SDK 0.1.0-alpha.25
Execution grant · Codexroute codex · gpt-5-codex (example)
your-app/src/ask.ts
import { createLocalAI } from "originlm";

const ai = await createLocalAI();
const [pick] = await ai.selection.resolve({
  query: "codex",
  requiredCapabilities: ["generation.text"],
  eligibleOnly: true,
});
const session = await ai.sessions.create({
  selection: pick.selection,
  workspaceId: "notes",
  permissionMode: "read_only",
});
const events = ai.events.subscribe({ sessionId: session.id });
await ai.turns.start({
  sessionId: session.id,
  requestId: crypto.randomUUID(),
  prompt: "Summarize the open questions in these notes.",
});
for await (const { payload } of events) {
  if (payload.type === "text_delta") render(payload.text);
  if (payload.type === "final") break;
}
One integration: switch agents and only line 5 (query) changes.
03 · Your app outputsample · live
Prompt

Summarize the open questions in these notes.

Responsecodex · gpt-5-codex

Three notes mention the launch. Two are drafts; one has a date: Thursday.

events.subscribe
  1. 01resolvequery "codex"
  2. 02grantapproved · workspace notes
  3. 03staterunning
  4. 04finalcompleted (73 chars)

02 · Problem & architecture

Every app you build re-integrates every AI client.

Your application does not have to reproduce client-specific paths, metadata parsers or streaming protocols for each AI client a user might have installed.

Three example apps, five clients: fifteen integrations, each with its own client-specific paths, metadata parsers, streaming protocols. With one local runtime, each app integrates once.

Without OriginLM: three apps each integrating five clients, fifteen integrations.your-appnotes-appphoto-sorterClaude CodeCodexAntigravityCursorOllama
Without OriginLM 3 × 5 = 15 integrations
With OriginLM: three apps each integrate once with OriginLM, which connects to all clients.OriginLMlocal runtimeyour-appnotes-appphoto-sorterClaude CodeCodexAntigravityCursorOllama
With OriginLM 3 apps, one integration each. Example apps.

One machine · No relay

Nothing passes through an OriginLM server, because there isn’t one.

Your code talks to the SDK. The SDK talks to a runtime on the same machine, which drives the clients the user installed.

01 · local

Your app

Electron, Tauri, GPUI, Node, Python, or a browser extension page.

  • user clicks Connect
02 · local

originlm SDK

npm, crates.io and PyPI. Imports are inert until you call it.

  • shared broker
  • stdio helper
  • loopback HTTP
03 · local

OriginLM runtime

Discovery, evidence, grants, sessions and events. Runs locally.

  • grants
  • sessions
  • events
04 · local

Installed clients

The tools the user already signed in to, driven via their own interfaces.

  • Claude Code
  • Codex
  • Antigravity
  • Ollama
05 · outside (unless local)

Provider

The route’s provider, under its own terms. Local model routes stay on the device.

  • subscription
  • metered
  • local
Steps 01–04 stay on the user’s machine Dashed line: machine boundary — no OriginLM relay or telemetry

03 · How it works

Discover. Grant. Call.

  1. Step 01snapshot.get

    Discover

    Passive discovery finds the AI clients already installed, from metadata only. No secrets read, no network calls, nothing at import time.

    Provider, installation, profile, account, connection, route, model, billing and quota-pool identities stay distinct. Unknown and unsupported are different states; nothing is guessed.

    const { connections, quotaPools } =
      await ai.snapshot.get();
  2. Step 02grants.request

    Grant

    Discovery is not permission. The host app grants execution explicitly, scoped to connections and workspaces. grants.request only asks: it returns requires_host_approval and changes nothing.

    Metadata, execution, workspace access, tools and paid options are separate, revocable, per-app grants.

    await ai.grants.request({
      connectionIds: [pick.connectionId],
      allowPaid: false,
    }); // never approves itself
  3. Step 03turns.start

    Call

    Resolve a route by capability, open a session, stream the turn. Typed events from a cursor: text deltas, approvals, usage, final.

    Native model IDs and option descriptors are preserved. There is no fake universal Low/Medium/High.

    await ai.turns.start({
      sessionId: session.id,
      requestId,
      prompt,
    });
Granted sessions carry:
  • Streaming text
  • Approvals
  • Cancellation
  • Image input
  • Host MCP tools (read-only by default)
  • Resumable sessions
  • Scoped artifacts

04 · SDKs

One protocol. Three SDKs.

TypeScript, Rust and Python clients speak the same JSON-RPC protocol to the same runtime. The TypeScript and Python SDKs are typed protocol clients generated from the Rust contracts.

Importing the package never scans, launches a process or reads a credential. Discovery runs when you call it.

  • Embedded libraryThe Rust facade embeds the runtime in-process when no helper exists.
  • Native helperThe standalone originlm executable: stdio, HTTP/SSE, broker and Native Messaging transports.
  • Shared brokerOne local service many apps attach to, each with its own token and identity.
  • TypeScript & Python SDKsTyped protocol clients generated from the Rust contracts.
  • React hooks & selectorsOptional hooks and eight selector layouts.
hello.mjs
import { createLocalAI } from 'originlm';
const ai = await createLocalAI();
try {
  const snapshot = await ai.snapshot.get();
  console.log(ai.mode, snapshot.revision);
} finally {
  await ai.close();
}

npm install originlm@alpha

05 · Control center

And yes, it tracks allowances too.

The control center: a native desktop app and a terminal UI over the same public API. Overview, Providers, Models, Usage charts, Connected apps, Sessions, Playground, Diagnostics.

It shows quota windows only as the client reports them. Unknown stays unknown, never a guessed zero.

cargo run -p originlm-desktop
Allowances · percent left in each reported windowExample data · synthetic
  • CodexPersonal workspace · Included plan
    Signed in
    Session window75% left
    Resets in 59mExample data
  • CodexWork workspace · Included plan
    Cached sign-in
    Weekly windowStale30% left
    Reset time not reported
  • AntigravityGoogle workspace · Gemini models
    Signed in
    Count without a published total17 requests used
    No published total
  • OllamaOn this device · Local runtime
    Local
    Allowance windowNot reported
    Local route — no allowance window

06 · Install

Install OriginLM.

  • npmnpm install originlm@alpha
  • pippip install originlm==0.1.0a25
  • cargocargo add originlm@=0.1.0-alpha.25

Published alpha on npm (the alpha tag), PyPI and crates.io at 0.1.0-alpha.25. The API can change between alpha revisions. MIT licensed.