Intuit is a D library for LLM completions, embeddings, and typed decision requests, with a focus on local models. It connects to provider APIs without external language bindings.
Endpoints name a model with each request and leave conversation history to the caller. Inference-capable routers keep their own history and use an active model. Both expose shared configuration and response types.
dub add intuitStart an OpenAI-compatible server and load a chat model first. This example assumes a server at http://localhost:1234 and a model ID of llama3. Replace them with your server's settings.
import intuit;
import std.stdio : writeln;
auto ep = new OpenAI("http://localhost:1234");
Context ctx;
ctx.system("You are a helpful assistant.");
ctx.user("Why is the sky blue?");
Completion result = completions(ep, "llama3", ctx);
writeln(result.text);Use a base URL without /v1 or a trailing slash. Intuit appends request paths directly. It doesn't start servers or load models. See Quick Start for a complete program and a router alternative.
Provider adapters expose different operations. Support also depends on the server and selected model.
| Endpoint | Module |
|---|---|
OpenAI |
intuit.provider.openai |
Claude |
intuit.provider.claude |
Qwen |
intuit.provider.qwen |
TypeSafe |
intuit.provider.typesafe |
OpenAI handles compatible APIs, Qwen adds provider settings and XML tool-call extraction, Claude uses Anthropic Messages, and TypeSafe handles System One decisions. See Endpoints for supported operations and limitations.
Routers expose model catalogs through IRouter. OpenRouter and Zen also support inference and keep conversation history.
| Router | Requests |
|---|---|
| OpenRouter | Completions, embeddings, and System One decisions. |
| Zen | Completions for supported API families. |
| LiteLLM | Catalog only. |
| Models.dev | Catalog only, without authentication. |
See Routers for usage and Model Catalogs for discovery. Streaming isn't implemented.
Guides are published at mortifying.si/intuit, covering installation, endpoints, routers, model catalogs, and shared request, response, tool, and error references.
Development notes live in Testing and Contributing.
Intuit is licensed under Apache-2.0.