Local AI for BlizCloud apps
Language models on BlizCloud's own hardware, behind an API every OpenAI client already speaks. Nothing an app sends is written anywhere, and a private app's data never leaves the cluster.
Ask it something
An app's server asks, with the app's key, from inside the cluster: the API is not reachable from outside (through the public address only the admin page answers, behind BlizSSO). The base URL (the service's address inside the cluster) and the key come from the app's environment (BLIZAI_URL, BLIZAI_KEY).
curl "$BLIZAI_URL/chat/completions" \
-H "Authorization: Bearer $BLIZAI_KEY" -H "Content-Type: application/json" \
-d '{"model": "smart", "messages": [{"role": "user", "content": "Hvad er hovedstaden i Danmark?"}]}'
Any OpenAI client library works with a new base URL:
from openai import OpenAI
client = OpenAI(base_url=os.environ["BLIZAI_URL"], api_key=os.environ["BLIZAI_KEY"])
answer = client.chat.completions.create(model="smart", messages=[{"role": "user", "content": "Hej!"}])
vectors = client.embeddings.create(model="embed", input=["en tekst", "en anden"])
The whole API is in /openapi.json: chat completions (also streaming, tools, JSON answers, pictures in), embeddings, the models, jobs for work that can wait, and an app's own queue and counts.
Ask for a kind of model, not a machine
An app names an alias, or a model by its id. The model behind an alias can change (when a GPU is added, when a better model arrives); the answer's model field and the header x-blizai-model say which model answered. The first candidate that a node this request may use can run wins.
| Alias | Candidates, best first |
|---|---|
| fast | gemma-4-e4b-it |
| smart | gemma-4-26b-a4b-it → gemma-4-12b-it |
| vision | gemma-4-26b-a4b-it → gemma-4-12b-it → gemma-4-e4b-it |
| ultra | gemma-4-31b-it → gemma-4-26b-a4b-it |
| code | qwen3.8-flash-next → gemma-4-26b-a4b-it |
| rogue | qwen3.8-27b-uncensored |
| rogue-code | qwen3.8-flash-next-uncensored → qwen3.8-27b-uncensored |
| embed | bge-m3 |
| transcribe | edda-v0.2 → whisper-large-v3-turbo |
| Model | What it is | Can | Context (tokens) | Licence |
|---|---|---|---|---|
bge-m3 | BGE-M3 (Q8) | embeddings, 1024 numbers | 8,192 | MIT |
edda-v0.2 | Edda v0.2 (Whisper large-v3-turbo trained on Danish, Q5) | speech to text | 448 | Apache-2.0 |
gemma-4-12b-it | Gemma 4 12B (QAT, 4-bit) | chat, tools, JSON answers, pictures | 16,384 | Apache-2.0 |
gemma-4-26b-a4b-it | Gemma 4 26B A4B (QAT, 4-bit) | chat, tools, JSON answers, pictures | 16,384 | Apache-2.0 |
gemma-4-31b-it | Gemma 4 31B (QAT, 4-bit) | chat, JSON answers, pictures | 16,384 | Apache-2.0 |
gemma-4-e4b-it | Gemma 4 E4B (QAT, 4-bit) | chat, tools, JSON answers, pictures | 16,384 | Apache-2.0 |
qwen3.8-27b-uncensored | Qwen3.8 27B Uncensored (orcarouter, abliterated; bartowski Q4_K_M) | chat, JSON answers, pictures | 16,384 | Apache-2.0 |
qwen3.8-27b | Qwen3.8 27B (Q4_K_M) | chat, JSON answers, pictures | 16,384 | Apache-2.0 |
qwen3.8-flash-next-uncensored | Qwen3.8 Flash-Next 180B abliterated v2 (huihui-ai; unsloth UD-Q4_K_XL) | chat, JSON answers | 32,768 | Qwen Community License 1.0 |
qwen3.8-flash-next | Qwen3.8 Flash-Next 180B (UD-Q4_K_XL) | chat, tools, JSON answers | 32,768 | Qwen Community License 1.0 |
whisper-large-v3-turbo | Whisper large-v3-turbo (Q5) | speech to text | 448 | MIT |
GET /v1/models says what each alias means for your key right now, and whether it is loaded.
These models can think before they answer. Here they do not unless you ask: "reasoning_effort": "low" (or medium, high) turns it on, the answer then also has reasoning_content, and the thoughts count toward max_tokens. On CPUs thinking costs many seconds; leave it off for an answer someone waits for.
Embeddings from two models cannot be compared. Keep the answer's model with an index and make the index again when it changes, or ask for the model by id instead of embed.
A key and its privacy class
A key is <app-id>.<secret> and belongs in a server or a headless node, never in a phone or a web page. BlizGPT keeps only its SHA-256. Every app has a privacy class:
| Class | What it means |
|---|---|
private (the default) | The app's data is only ever sent to nodes inside the cluster, whatever the alias and whatever else is free; if none can serve it the answer is 503 no_private_capacity. Never answered through the public address, whatever the service's settings: there Cloudflare ends the TLS and could read what passes. |
standard | The data may also be served by a remote backend where an alias has one. One request can ask for more with X-BlizAI-Privacy: private. |
Any key that comes through the public address gets 403 private_route_required. An app's own users (a phone) never ask BlizGPT directly: they ask the app's server, which asks here. (A service can be set to answer standard keys there, BLIZAI_PUBLIC_API=1; BlizCloud's is not.)
For both classes a prompt, a picture, an answer or an embedding is never written to a log, a trace, a file or a database. What is kept is counts: the app, the model, tokens, milliseconds, an error's code.
Speech to text
POST /v1/audio/transcriptions is OpenAI's: a form with file (a WAV file of 16-bit PCM; 16 kHz mono is what the model hears, so send that; at most 25 MB and 15 minutes), model (transcribe), and if you like language (da), prompt (names and words to expect) and response_format (json, verbose_json with the time of each part, or text).
curl "$BLIZAI_URL/audio/transcriptions" -H "Authorization: Bearer $BLIZAI_KEY" \ -F model=transcribe -F language=da -F [email protected]
GET /v1/audio/stream is a WebSocket for sound as it is spoken: a start message, then 16 kHz mono 16-bit PCM in pieces, and the text comes back while it is said (partial) and for good at each pause (final). The messages are in /openapi.json.
The sound is held in memory while it is turned into text, and nowhere after. What is counted is its seconds.
Waiting, and work that can wait
A loaded model answers a few requests at once; the rest wait their turn, fairly between apps. A streaming request is told where it is with comment lines (: queued 3, : loading) that OpenAI clients skip. X-BlizAI-Max-Wait: 30 bounds the wait (then 503 queue_timeout with Retry-After); closing the connection cancels.
X-BlizAI-Priority: batch marks work that can wait: it runs when nobody waits for an answer. POST /v1/jobs hands over up to 1000 requests at once, to run now or in the night. Because nothing is written anywhere, a job and its answers live in memory only: they are gone 24 hours after it finished, when it is deleted, and when the service restarts. A job must be safe to send twice.
Errors
OpenAI's shape: {"error": {"message", "type", "code", "param"}}. 429 and 503 carry Retry-After. The message never repeats anything from the request.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The request is not valid. |
| 400 | context_length_exceeded | The messages are longer than the model's context. |
| 400 | capability_not_supported | The model cannot do what the request asks of it. |
| 401 | unauthorized | A valid key is required. |
| 403 | https_required | Plain http is not accepted. |
| 403 | private_route_required | The API is only reachable inside the cluster, not through the public address. |
| 403 | model_not_allowed | This key may not use that model. |
| 403 | sealed_required | Through the public address the body must be sealed to the service's key. |
| 403 | scope_not_allowed | This token may not use that route. |
| 403 | forbidden | Not allowed. |
| 403 | learning_off | The learning layer is switched off for this app. |
| 404 | model_not_found | No such model or alias. |
| 404 | job_not_found | No such job. Jobs are kept in memory only: send it again. |
| 404 | learning_item_not_found | No such learning item for this app (and subject). |
| 404 | not_found | Not found. |
| 405 | method_not_allowed | Method not allowed. |
| 409 | learning_full | The learning layer's limit is reached: delete items first. |
| 413 | request_too_large | The request is too large. |
| 415 | unsupported_audio | The sound must be a WAV file of 16-bit PCM. |
| 429 | device_rate_limited | This device's allowance is used up. |
| 429 | rate_limited | The app's requests a minute are used up. |
| 429 | queue_full | Too many requests are waiting. |
| 500 | internal_error | Something went wrong in the service. |
| 502 | upstream_error | The model's runtime failed. |
| 503 | no_capacity | No node can run this model now. |
| 503 | no_private_capacity | No node inside the cluster can run this model now, and the request is private. |
| 503 | queue_timeout | The request waited too long in the queue. |
| 503 | learning_unavailable | The learning layer is not set up here, or its store cannot be reached now. |
| 504 | timeout | The model did not finish in time. |
Testing an app against it
With the fake runtime (BLIZAI_FAKE_NODE=1) no model is loaded and nothing leaves the machine. The answer is fake(<model>): and the last user message, or exactly the text after [[say: … ]] in it, so a test can make it answer anything. [[fail:<code>]] makes it fail and [[wait:<ms>]] makes it wait. Embeddings are a unit vector made from a hash of the text.