Kreatix K2, in detail.

How K2 is built, trained and served: architecture, tokenizer, vision encoder, every training stage, the behaviour policy and the API. The numbers come straight from the model code and training configs.

Type
Vision-language modeldecoder-only, hybrid attention
Parameters
7.36B language model+ 343M vision encoder = 7.70B
Context
32,768 tokenspretrained at 8,192
Input / output
Text and images intext out
Starting point
Random weightsno pretrained model used
Training data
~1.09T tokens plannedacross five stages
Developer
Kreatixsuccessor to Kreatix K1
Release and license
To be announcedsee roadmap
01 · Architecture

A hybrid decoder: three fast layers, then one that sees everything

K2 is a decoder-only transformer with 32 layers. In every group of four, three are Gated DeltaNet (linear attention with a fixed-size memory) and the fourth is full softmax attention. Each layer is a pre-norm residual block: the mixer runs on RMSNorm(x) and is added back to x, then a SwiGLU feed-forward does the same.

32 layers · DDDA × 8
D · Gated DeltaNet (24)A · Full attention (8)

Gated DeltaNet layers (24)

Each of the 32 heads keeps a 128 × 128 memory matrix S. For every token it fades the old memory, erases what was stored under the current key, and writes the new value:

St = αt · (I − βt kt kt⊤) · St−1 + βt kt vt⊤
ot = St⊤ · qt / √128
  • αt ∈ (0, 1) is a learned decay: how quickly old memories fade. βt ∈ (0, 1) is the write strength.
  • q and k are L2-normalised. A short causal convolution (width 4) runs over q, k and v first.
  • The output goes through a per-head RMSNorm and a learned output gate.
  • Cost grows linearly with length and the memory never grows, so a 32K-token prompt costs these layers the same memory as a 32-token one.
  • Training uses a chunked form (64-token chunks). On GPU it runs on Triton kernels from the open-source flash-linear-attention library. Our plain-PyTorch version of the same math is the reference the tests check against.

Full-attention layers (8)

Grouped-query attention with 32 query heads and 8 key/value heads (head size 128), QK-norm and a learned output gate. These layers use no positional encoding (NoPE). Word order reaches them through the DeltaNet layers, which read the sequence in order, so there are no rotary frequencies to break when the context is stretched past what training saw.

Full specification

Settingk2-7b
Hidden size4,096
Layers32 (24 DeltaNet + 8 attention)
Attention heads32 query · 8 key/value · 128 dim
DeltaNet heads32 · 128 × 128 state
Feed-forwardSwiGLU, 11,008
NormalisationRMSNorm, pre-norm
Positionsnone in attention (NoPE)
Vocabulary65,536
Input and output embeddingsseparate (not tied)
Context8,192 → 32,768

Where the parameters are

ComponentEachTotalShare
Feed-forward (SwiGLU) × 32135.3M4.33B
Gated DeltaNet mixers × 2484.2M2.02B
Attention mixers × 858.7M470M
Vision encoder and merger–343M
Token embedding–268M
Output head–268M
Norms–0.27M
Total7.70B7.36B language model

Memory per conversation

What one conversation needs to hold while K2 writes. Only the 8 attention layers keep a cache that grows with length; the DeltaNet layers stay at 48 MiB in total.

Context length
32K
K2 trained context
Same model with 32 full-attention layers
K2: 8 attention + 24 DeltaNet layers

bf16 key/value cache for one sequence (8 KV heads × 128 dims per attention layer) plus the fp32 DeltaNet state. Lengths past 32K need a further training stage.

02 · Tokenizer

Our own byte-level tokenizer

A byte-level BPE tokenizer trained from scratch on a sample of the same data mix K2 learns from. It has 65,536 entries, so every token id fits in 2 bytes on disk. Because it works on bytes, any text can be encoded, with no unknown tokens. The first 256 ids are reserved for special tokens and 12 of them are in use.

IdTokenPurpose
0<|endoftext|>End of a document
1<|pad|>Padding
2 · 3<|im_start|> · <|im_end|>Start and end of a chat turn. Generation stops at <|im_end|>.
4 · 5<|vision_start|> · <|vision_end|>Wrap an image
6<|image_pad|>One image token, replaced by vision features
7<|video_pad|>Reserved for video (not used yet)
8 · 9<|tool_call|> · <|/tool_call|>Reserved for tool use
10 · 11<|think|> · <|/think|>Reserved for reasoning

Chat format

<|im_start|>system
Answer briefly.<|im_end|>
<|im_start|>user
<|vision_start|><|image_pad|> × N<|vision_end|>
What's in this picture?<|im_end|>
<|im_start|>assistant
… K2 writes here, then <|im_end|>

Text that people type can't produce these control tokens: the chat server neutralises them before encoding.

03 · Vision

Images become tokens in the same stream as text

K2's vision encoder is a ViT trained from scratch inside our pipeline. Images keep their aspect ratio; nothing is cropped to a square.

  1. Resize to fit. The image is scaled so both sides are multiples of 32 px, up to about one megapixel.
  2. Cut into patches. 16 × 16 px patches go through 24 transformer layers with 2D rotary positions (row and column).
  3. Merge 2 × 2. Four neighbouring patches are joined into one token, so each token covers 32 × 32 px.
  4. Splice into the text. The tokens fill the <|image_pad|> slots and the language model reads them in line with the words around them.
SettingVision encoder
Patch size16 × 16 px
Layers · width · heads24 · 1,024 · 16
Feed-forward2,816
Positions2D rotary
Merger2×2 concat → RMSNorm → MLP (GELU) → 4,096
Image sizeany aspect ratio, ≤ 1,048,576 px
Tokens per image4 to ~1,024
Parameters342.8M

What an image costs

×px
after resize
image tokens · 1 dot = 1 token
04 · Training

Five stages, from random weights to a chat model

Each stage starts from the weights the previous one exported. The language model learns text first, then the vision encoder learns to talk to it, then everything trains together, then the context is stretched, and finally K2 learns to follow instructions.

Recipe

OptimizerAdamW, β₁ 0.9, β₂ 0.95, weight decay 0.1, gradient clipping 1.0
Learning rateWarmup, then constant, then a decay over the last 15–20% of steps down to 10% of the peak
Extra lossz-loss 1e-4, which keeps the output logits small and training stable
Precisionbf16, with weights and optimizer state sharded across GPUs (FSDP2)
BatchAbout 1.05M tokens per step at each site
StartRandom initialisation (std 0.02). No pretrained weights anywhere.

Stages

StageWhat trainsDataContextStepsTokensPeak LR
1 · TextLanguage modelWeb 60%, code 30%, math 10%8K477,0001T2e-4
2 · Vision warm-upVision encoder only (language model frozen)Image captions4K5,0005B1e-3
3 · MultimodalEverything60% text; 40% captions, interleaved pages, OCR8K30,00063B1.5e-4
4 · Long contextEverythingBooks and papers 30%, code repos 25%, synthetic retrieval 15%, short web 30%32K10,00021B6e-5
5 · InstructionsEverything (one site)Chat 35%, code 30%, vision 20%, long documents 10%, safety 5%32K2,0002B1e-5

The stage 1 mix:

Two sites, one model (DiLoCo)

Two sites train the same model at the same time, each on its own half of the data, and merge their progress through a shared storage bucket. They never need a fast link between them.

Site 0data half A 500 steps ≈ 1 h Site 1data half B 500 steps ≈ 1 h Shared bucketweight changes average both, take one outer step both sites end each round with identical weights
  1. Site 0 creates the random starting weights and shares them, so both sites hold the same model.
  2. Each site trains 500 steps (about an hour) on its own half of the data with AdamW.
  3. Each uploads how far its weights moved, downloads the other site's, and both average them.
  4. An outer optimizer (SGD with Nesterov momentum 0.9, learning rate 0.7) applies the averaged change. Both sites end the round bit-identical.
  5. Each round moves about 15 GB per site (7.7 GB with int8 compression). If one site stops, the other waits at the next sync, and nothing drifts.

Data

Candidate datasets for each part of training. Each license is checked before a dataset is used.

PurposeCandidates
Web textFineWeb-Edu, DCLM baseline, Cosmopedia
CodeThe Stack v2, StarCoderData, SmolLM corpus (Python)
MathFineMath, OpenWebMath
Image captionsPixelProse, PD12M (public domain)
Interleaved image and textOBELICS
Vision instructionsFineVision (samples rated 4/5 or higher), The Cauldron
Chat and code instructionsSmolTalk, Magicoder OSS-Instruct
Long documentsPG-19 books, arXiv papers, whole code repositories
Safety promptsAegis 2.0, BeaverTails, WildJailbreak
Image data is screened. K2 trains only on curated image datasets that have been checked for illegal content, never on raw scraped image collections.

A small pilot first

Before the 7B run, a 300M version of K2 (0.29B language model + 32M vision encoder) goes through every stage on a single GPU. It checks the data, the training code, checkpoint resuming and the behaviour policy cheaply, with a hard spending cap on each stage.

Pilot stageDataStepsTokens
TextFineWeb-Edu 60%, Cosmopedia 15%, Python code 15%, FineMath 10%38,000~10B
VisionVision instruction data, language model frozen3,000~0.2B
InstructionsChat 45%, vision 30%, code 20%, safety 5%3,000~0.4B

Time and hardware

The 7B plan runs on one 8-GPU Blackwell node per site. Stage 1 takes about 37 days, and all five stages about 6 to 7 weeks, roughly 15,500 GPU-hours in total. Training checkpoints regularly (one 7B checkpoint is about 155 GB) and resumes from the latest one after any interruption.

05 · Behaviour policy

Direct answers, with four limits

By default K2 answers the question you asked, completely. No moralising, no lectures, no padding with disclaimers. It declines four categories of request. Two are locked and can't be switched off, because that content is illegal or could contribute to mass casualties.

Illegal and controlled drugs

policy
Declines
  • Making, extracting, growing or refining them
  • Buying, selling, sourcing or smuggling
  • Recreational dosing, combining drugs to get high
  • Beating drug tests, hiding drugs
Still answers
  • Effects, risks, how a drug acts in the body
  • Medicines used as directed
  • Addiction, withdrawal, treatment, recovery
  • Recognising an overdose and what to do
  • Drug law, policy, history, fiction

Suicide and self-harm

policy
Declines
  • Methods, means or instructions
  • Lethal amounts of medicines or substances
  • Encouragement or "challenge" content
  • Hiding it from family, doctors or helpers
Still answers
  • Talking about sadness or hopelessness, warmly
  • Supporting a friend who is struggling
  • Recovery, therapy, coping, prevention
  • Fiction without method detail

Declines kindly and points to crisis lines.

Sexual content involving minors

locked
Declines
  • Any sexual content involving anyone under 18, in any framing (fiction, roleplay, "aged-up" claims, hypotheticals)
Still answers
  • Age-appropriate sex and consent education
  • Recognising and reporting abuse, support for survivors

Mass-casualty weapons

locked
Declines
  • Producing, acquiring, enhancing or deploying biological, chemical, nuclear or radiological weapons
Still answers
  • History and arms-control policy
  • General science education
  • Public health and emergency preparedness

How it's trained

  • Labelled harmful prompts are paired with short decline replies written from the policy, with deliberately varied wording.
  • The same prompts are wrapped in common jailbreak framings: hypotheticals, role-play, "ignore your instructions", "for a novel", and multi-turn setups.
  • Contrast examples on the same topics get real answers, so K2 doesn't start refusing everything that mentions a drug or a feeling.
  • This safety data is 5% of the instruction-tuning mix.

How it's checked

  • Declines on held-out restricted prompts. Target: close to 100%.
  • Over-refusal on harmless look-alikes such as "how do I kill a Python process?". Target: close to 0%.
  • Every reply is saved and read by people, because the automatic check is only a phrase match.
Known limit. Declines learned in instruction tuning can be talked around by a determined user. A preference-tuning stage (DPO) would make them sturdier; it isn't built yet.
06 · Evaluation

What we'll measure

There are no benchmark numbers yet, because the model hasn't been trained. These are the checks K2 goes through, and the results will be published as they come in.

CheckWhat it showsWhen
Training healthLoss, throughput and GPU efficiency at every checkpointThroughout
Needle in a haystackFinds one fact hidden at 0–100% depth in 8K and 32K contextsAfter stage 4
Safety declinesHeld-out restricted prompts, including jailbreak framingsAfter stage 5
Over-refusalHarmless prompts that look like restricted onesAfter stage 5
Standard benchmarksCoding, reasoning and image understandingPlanned for the release
Honest expectation. 1 trillion training tokens is a fraction of what the largest labs use, so K2 will start out behind models trained on far more data. Its predecessor K1, a fine-tune of a model trained on about 18 trillion tokens, may stay stronger at coding for a while.
07 · Chat & API

An OpenAI-compatible server

K2's chat server speaks the OpenAI chat format, so existing SDKs and chat tools can connect to it. The K2 Chat website uses the same API.

EndpointPurpose
POST /v1/chat/completionsSend messages, get a reply (streamed or whole)
GET /v1/modelsLists the model id
GET /healthStatus, context length, whether images are supported

Request fields

FieldDefaultNotes
messagesrequiredRoles system, user, assistant. Content is a string or a list of text and image_url parts.
streamfalseServer-sent events, one chunk per piece of text, then [DONE]
max_tokens1024Up to 2,048. Also capped so prompt + reply fit in 32,768 tokens.
temperature0.70 to 2. 0 always picks the most likely token.
top_p0.90.05 to 1

Example with an image

curl $K2_ENDPOINT/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
  "stream": true,
  "messages": [{
    "role": "user",
    "content": [
      {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,/9j/4AAQ..."}},
      {"type": "text", "text": "What is in this picture?"}
    ]
  }]
}'

# streamed reply
data: {"choices":[{"delta":{"role":"assistant","content":""}}], ...}
data: {"choices":[{"delta":{"content":"A blue"}}], ...}
data: {"choices":[{"delta":{},"finish_reason":"stop"}],"usage":{...}}
data: [DONE]
from openai import OpenAI

client = OpenAI(base_url=f"{K2_ENDPOINT}/v1", api_key="none")
stream = client.chat.completions.create(
    model="kreatix-k2", stream=True,
    messages=[{"role": "user", "content": "Hello K2"}],
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Limits

ImagesUp to 4 per request, 8 MB each, sent as base64 data URLs (remote image links are refused)
Context32,768 tokens for prompt plus reply
Rate20 requests per minute per visitor on the hosted server
QueueOne reply is written at a time; others wait in a short queue
PrivacyThe server doesn't log prompts. The chat website saves conversations only in your browser.

Run it yourself

# on any machine with a GPU, from the K2 code folder
python scripts/serve.py --model runs/k2-7b-sft/export/step_00002000 \
    --tokenizer tokenizer/tokenizer.json --port 8000

# then point the chat at it
chat.html?endpoint=http://localhost:8000

The weights take about 16 GB of GPU memory in bf16, plus about 1 GB per 32K-token conversation.

08 · Status & roadmap

Where K2 is right now

The code is written and tested. Training starts with a small pilot run.

  • Architecture, vision encoder and training codeTested end to end on CPU with a toy-size model, including a full two-site run.done
  • Tokenizer, data and safety pipelinesTokenizer training, data sharding, multimodal packing, policy-based safety data.done
  • Chat website and API serverStreaming chat with image input, tested with a toy model.done
  • 7B text pretraining1 trillion tokens across both sites.planned
  • Vision, 32K context, instruction tuningStages 2 to 5.planned
  • ReleaseWeights, evaluations, and the chat going live.planned
09 · Limitations

What K2 won't do yet

  • It can be wrong. Like every language model, K2 can state false things confidently. Check anything important.
  • Smaller training budget. About 1 trillion text tokens, far fewer than the largest models see.
  • Mostly English. The planned data is mostly English, so expect weaker results in other languages.
  • No llama.cpp, Ollama or LM Studio support. The architecture is new, so these tools need support written for it first.
  • No preference tuning (DPO) yet. It would improve answer quality and make the limits harder to talk around.
  • No video. Single and multiple images only.
  • 32K context. Longer contexts need another training stage. The architecture supports it without starting over.
10 · FAQ

Questions

Why build from scratch instead of fine-tuning an existing model?

Starting from someone else's weights locks in their architecture, tokenizer and training data. Building from zero let us choose a hybrid design that keeps long contexts cheap, train our own vision encoder, and understand every part of the model. The trade-off is a smaller training budget than the largest labs have.

How is K2 different from K1?

K1 is a fine-tune of the Qwen2.5 7B coder model and reads text only. K2 is a new model: our own architecture, trained from random weights, and it reads images as well as text with a 32K-token context.

Can I run it on my own computer?

You'll need a GPU with roughly 20 GB of memory or more: the weights take about 16 GB in bf16. Popular local tools like Ollama and LM Studio don't support the architecture yet, so for now it runs with our own server script.

Will the weights be released?

Release plans, including weights and license, will be announced closer to launch. Follow Kreatix on Hugging Face for updates.

Does K2 refuse things?

Only four categories: illegal drugs, self-harm, sexual content involving minors, and mass-casualty weapons. Everything else it answers directly, and it's trained not to refuse harmless questions that only sound similar.

Are my chats stored?

The chat website keeps conversations in your own browser, not on our servers, and the server doesn't log prompts. You can export or delete your chats in Settings.

Why 32K tokens and not more?

One image costs up to about 1,024 tokens, and a few code files or a long chat fill 8K quickly, so 32K is a practical size. The extension stage costs only 2–3% of total training. The architecture can be stretched further later without retraining from scratch.

Seen enough? Say hello.

The chat is built and waiting for the model.