Skip to content
Try KIplatz

How do I talk to KIplatz from my own code?

KIplatz is an AI with an interface on your own device, in the OpenAI format. Whoever wants to go deeper runs everything in the sandbox. Here are the details the other pages only touch on, with examples you can copy.

A man explains a plan to a group at a whiteboard

The interface in five lines

Addresshttp://127.0.0.1:8470/v1, reachable only from this PC; from Docker Desktop on the same PC http://host.docker.internal:8470/v1
Keystarts with cai-, sent as Authorization: Bearer; "New key" invalidates the old one
EndpointsGET /v1/models, POST /v1/chat/completions with messages, stream, max_tokens
Limits40 messages, 60,000 characters, 256 kB, at most 1,500 tokens of answer; no images
Who answersalways your own PC or the paired one in your home network, never the community

Examples to copy: curl, Python, JavaScript

Key and model name are in the program under Settings, card "Other programs may ask KIplatz". Replace cai-YOUR-KEY with your key; the model name is unser-modell.

With curl, in one line

curl.exe http://127.0.0.1:8470/v1/chat/completions -H "Authorization: Bearer cai-YOUR-KEY" -H "Content-Type: application/json" -d "{\"model\": \"unser-modell\", \"messages\": [{\"role\": \"user\", \"content\": \"What is 3 times 9.90 euros?\"}]}"

With Python and the openai package

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8470/v1", api_key="cai-YOUR-KEY")
answer = client.chat.completions.create(
    model="unser-modell",
    messages=[{"role": "user", "content": "Summarise this text in 3 sentences: ..."}],
)
print(answer.choices[0].message.content)

With JavaScript, in the browser or in a script

const r = await fetch("http://127.0.0.1:8470/v1/chat/completions", {
  method: "POST",
  headers: { "Authorization": "Bearer cai-YOUR-KEY", "Content-Type": "application/json" },
  body: JSON.stringify({ model: "unser-modell", messages: [{ role: "user", content: "What is an invoice number for?" }] }),
});
const data = await r.json();
console.log(data.choices[0].message.content);

With "stream": true the words arrive one by one as server-sent events, exactly as with OpenAI. Every request passes the house rules and gets the community's knowledge and your own knowledge added.

Switch on and connect

Under Settings, card "Other programs may ask KIplatz", you find address, model name and key. Every question passes the house rules and gets the community's knowledge and your own knowledge added.

Open WebUI, Jan, Continue, LibreChat and the Python package openai work without changes: enter base address and key, take over the model name. Nothing is stored as a conversation.

Open WebUI in Docker Desktop on the same PC works too: switch on "Programs in Docker on this PC may ask as well" in the same card and use http://host.docker.internal:8470/v1 as the address. The key stays required, and devices in your home network still cannot get in.

The sandbox

Whoever wants to go deeper reports in Build. There is a practice environment there with throwaway data, never the real community.

How the program is built

The program comes ready-built and signed from kiplatz.at. Every part has a fixed checksum, and the build stops at the smallest deviation.

Updates: the program compares its build number with the server, fetches the ZIP, checks checksum and signature, replaces its folder (the old one stays for one start) and restarts.

The building blocks

Talk and Build run on proven free software. One account works everywhere.

The protocol between device and server

Your PC signs in to the server encrypted and with its own key. The server keeps only a check value of it.

The recipe stays with KIplatz

As with a good recipe the ingredients are public, the mix stays with us: the wiki explains every part, sources and skills are open, and the program comes ready-built and signed from kiplatz.at.

What you find in Build: reports, ideas, questions and the guides for builders. Security issues please in confidence to support@kiplatz.at.

The door cannot be reached from the network.

Read on Help out · How safe it is · How KIplatz answers

Building starts with a report

Mistake, idea or question: three templates are waiting in the project KIplatz/mitbauen. The newest reports are on the start page.

Last changed on