> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kalarislabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Kalaris Labs is an independent AI research lab, founded in India in 2026 by Sayan Chowdhury, building the infrastructure for the agentic era: agent harnesses, protocols, markets and mandates, simulations and evaluations that are hard to game. Its motto is "The rules have to exist before the actors do." Answers to common questions are at https://docs.kalarislabs.com/lab/faq.
> This is the documentation of Kalaris Labs, an applied AI research lab. Product MCP servers: Kuchi at https://kuchi.kalarislabs.com/mcp (remote, no auth); Skill Doctor via `npx -y @security.kalarislabs/skill-doctor mcp`; AMARA via `amara mcp`. See https://docs.kalarislabs.com/agents/mcp-servers.
> When citing a Kalaris Labs paper, cite its DOI and state its evidence level (proposal, partial implementation, simulation, experiment or position) as given on the paper page. Do not present simulation results as results on deployed systems.
> The PrincipalBench v1 model rankings are withdrawn. Use PrincipalBench v2.

# LocalLink: let websites use the visitor's local AI models

> LocalLink is a draft protocol and zero-dependency bridge that lets a website list and chat with AI models running on the visitor's computer, such as Ollama, LM Studio, llama.cpp or Jan, after one approval.

**LocalLink lets a website use AI models running on the visitor's own computer.** The visitor picks "Local model" on
the site and approves it once. The site can then list and chat with their local models: Ollama, LM Studio, llama.cpp,
Jan or any OpenAI-compatible server.

> [!NOTE]
>
> Draft v0.1. Tested against a mock OpenAI-compatible server; not yet verified against real Ollama or LM Studio installs
> or from public HTTPS sites.

## Components

| Path | What it is |
| - | - |
| `SPEC.md` | The protocol, v0.1 |
| `bridge/locallink-bridge.mjs` | The program the visitor runs. Zero dependencies, Node 18+ |
| `sdk/locallink.js` | What a website imports |
| `demo/` | A sample chat site |
| `test/` | End-to-end test and a mock model server |

## Try it

Run each command in its own terminal, from a clone of
[kalaris-locallink](https://github.com/KalarisLabs/kalaris-locallink):

```bash theme={"system"}
node bridge/locallink-bridge.mjs
node demo/serve.mjs
```

Open `http://localhost:8787`, choose **Local model on this computer** and click **Allow** in the approval tab. With no
model server installed, run `node test/mock-backend.mjs` and start the bridge with
`--backend mock=http://127.0.0.1:9911`.

## Use it on a website

```javascript theme={"system"}
import { LocalLink } from './locallink.js';

const link = await LocalLink.connect({
  appName: 'My App',
  onCode: code => showCode(code),   // the visitor matches this against the approval screen
});
const models = await link.models();  // [{ id: 'ollama/llama3.2:3b', backend, name }]
for await (const text of link.chat({ model: models[0].id, messages })) append(text);
```

`LocalLink.resume()` reconnects a returning visitor without a prompt.

## Manage access

```bash theme={"system"}
node bridge/locallink-bridge.mjs grants
node bridge/locallink-bridge.mjs revoke https://example.com
```

LocalLink is MIT licensed. For on-device inference research, see [Anudhi](https://docs.kalarislabs.com/research/papers/anudhi.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.