xlocllm docs

xlocllm runs models in this browser window and exposes them to local Python programs through an OpenAI-compatible bridge at 127.0.0.1.

Python quick start

import xlocllm

runtime = xlocllm.runtime([
    xlocllm.unit(type="LLM", model="Qwen-3.5-0.8b"),
    xlocllm.unit(type="embedding", model="multilingual-e5-small"),
])
runtime.install()
runtime.run(port=1146)

OpenAI SDK

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:1146/v1", api_key="xlocllm")

The bridge only binds to loopback by default. Remote notebook runtimes are outside v1; local notebooks work because Python and the browser share the same machine.