Run your own AI and call it like any AI API

Run a model of your choice on your own machine with Olde, then give it an address with Endpoint. Your code sends messages and gets a chat completion back, the same way it would from any AI platform, except the model is yours and runs on your hardware.

Open Endpoint (API Maker)

Before you start

  • A Windows or Linux computer linked to your account with the OcaltQL Client. A graphics card makes answers faster, but is not needed for small models.
  • Enough memory on that computer for the model you want. Olde shows this before it installs anything.

Steps

  1. Open olde.ocalt.com, go to Library and pick a model. You can also search Hugging Face for any model published as GGUF files, such as a small Qwen, Llama or Gemma model.
  2. Tick the machine that should run it, choose the mode Local Split, check the plan, and press Install.
  3. When it is installed, open the model and press Start. Wait until it says it is running. Press Chat with it once to see it answer.
  4. On the model's page, press Give it an API address. Endpoint opens with Olde's “Ask a model” already chosen, and the machine and port already set. Only you can change those two; a caller never can.
  5. Give it a name, and under Who can call it choose Only with a key. Your machine does the work and every call uses your queries, so keep it to the people and programs you choose.
  6. In Try it, type a prompt such as “Say hello in five words” and press Try it. The model's real answer appears.
  7. Press Make the endpoint. Copy the key now, because it is shown only once, and copy the address.
  8. Call it from your code with a list of messages, as you would any AI chat API. The examples below show curl, Python and JavaScript.

Examples

curl

curl -X POST https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ek_your_key" \
  -d '{
    "messages": [
      {"role": "system", "content": "You answer in one short paragraph."},
      {"role": "user", "content": "What is a chat completion?"}
    ],
    "temperature": 0.3
  }'

Python

import requests

res = requests.post(
    "https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya",
    headers={"Authorization": "Bearer ek_your_key"},
    json={
        "messages": [{"role": "user", "content": "Write a haiku about Mondays."}],
        "max_tokens": 80,
    },
)
print(res.json()["choices"][0]["message"]["content"])

JavaScript

const res = await fetch("https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Authorization": "Bearer ek_your_key" },
  body: JSON.stringify({ messages: [{ role: "user", content: "Name three uses for a paperclip." }] }),
});
const answer = await res.json();
console.log(answer.choices[0].message.content);

Just a prompt

curl -X POST https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya \
  -H "Authorization: Bearer ek_your_key" \
  -d "prompt=Tell me a fact about the moon"

What happens next

The answer comes back in the usual chat completion shape: the reply is in choices[0].message.content, and usage says how many tokens it took. Code written for an AI platform's chat API needs only the new address and key.

Good to know

  • Send messages (the full conversation, as a list of role and content) or just a prompt. With a prompt you can also send system to say how the model should behave.
  • temperature and max_tokens work as they do on AI platforms. Leave them out to use the model's settings.
  • The address keeps working when you stop and start the model, because the endpoint reaches the machine and port, not a temporary link. The machine has to be on and the model running.
  • Answers come back whole, not word by word. A long answer on a slow machine can take a while; the endpoint waits up to ten minutes.
  • Each call uses your queries. Set Calls a minute, at most in the endpoint's settings to keep a busy caller in check.
  • Only models running in Local Split answer this way. Holographic modes answer in Olde's own chat.

Still stuck?

Tell us which step stopped you and what you saw on screen. We answer from Support.