intuit ~main

SDK for interfacing with AI LLMs and embeddings models with streaming, tools, routing, and much more.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Intuit

DUB Package License

Intuit is a library for interacting with AI LLM and embeddings endpoints, with a focus on local models. Endpoints, models, and routers are built around small interfaces so that new providers and routing strategies are straightforward to add.

An IEndpoint wraps one provider API. An IRouter sits beside one or more endpoints, maintains its own Context, and operates on a single active model at a time.

Installation

dub add intuit

Quick Start

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);

Endpoints are constructed with a base URL and an optional API key. Intuit does not normalize it; provider request paths such as /v1/chat/completions are appended to it. Intuit does not host endpoints — use a local server such as Ollama or LM Studio, a router, or the vendor's API directly.

Providers

Intuit provides endpoint and model definitions for the following providers:

EndpointModule
OpenAIintuit.provider.openai
Claudeintuit.provider.claude
Qwenintuit.provider.qwen

Support means the endpoint and model definitions are provided and tested for those API styles. OpenAI-compatible endpoints work with most local servers and many hosted models, but behavior varies by model version and capabilities.

Qwen extends OpenAI with Qwen-specific model parameters and XML tool-call extraction. Claude implements the Anthropic Messages API and does not support embeddings.

Routers

Routers sit beside endpoints with their own interface (IRouter) and request functions. A router juggles one or more endpoints internally, maintains its own Context, and operates on a single active model at a time. Setting the active model adjusts the maintained context's Compactor token limit to match the model's context window.

RouterDescriptionReference
OpenRouterOpenRouter router with dynamic model discovery.https://openrouter.ai/
LiteLLMLiteLLM proxy router. Catalog access only.https://docs.litellm.ai/

Router request functions omit the model parameter. When data is provided it is appended to the maintained context; when omitted, the existing context state is used:

auto router = new OpenRouter("sk-my-key");
router.active("openai/gpt-4o");

Completion result = completions(router, "Why is the sky blue?");
Completion followUp = completions(router);

Documentation

License

Intuit is licensed under Apache-2.0.

Authors:
  • cet
Dependencies:
unit-threaded
Versions:
1.3.1 2026-Sep-09
1.3.0 2026-Jun-09
1.2.0 2026-May-21
1.1.0 2026-Apr-22
1.0.0 2026-Apr-21
Show all 8 versions
Download Stats:
  • 2 downloads today

  • 2 downloads this week

  • 8 downloads this month

  • 10 downloads total

Score:
0.3
Short URL:
intuit.dub.pm