Skip to content
mentoor

Topic 5 of 6 · 6 min read

Checking a first local chat session

Goal: Read a local runner's startup log and say whether the model runs on the GPU, at what context length and with which template.

A local model that answers is not proof it is set up well: read the load log and test with a real prompt to confirm GPU use, context length and chat template.

Check yourself · 1 of 3

A load log says 'offloaded 0/33 layers to GPU'. What does it mean?

Choose one answer

Why it matters

Local runners fail quietly. A model that runs on the CPU still replies, only slowly. A model with the wrong chat template still replies, only worse. A prompt longer than the window still gets an answer, from the part that was kept. You find these in the log and with small tests, not by looking at the chat.

What to read in the log

  1. GPU use. Look for a line saying how many layers were offloaded, for example "offloaded 33/33 layers to GPU". If it says 0 layers, or only a part, the rest runs on the CPU. In Ollama, ollama ps shows the split in its PROCESSOR column.
  2. Context length. Find the context the server was started with (n_ctx). It may be smaller than what you asked for, or smaller than the model supports (n_ctx_train).
  3. Chat template. The model expects its own markers around system, user and assistant messages. The log or ollama show prints the template. If it is missing or generic, replies may ramble, repeat or leak tags such as <|im_end|>.
  4. Speed. The runner prints tokens per second after a reply. Note it as your baseline.

A log excerpt:

load_tensors: offloaded 33/33 layers to GPU
llama_context: n_ctx = 8192
llama_context: n_ctx_train = 131072
chat template: chatml
eval time = 2350 ms / 94 runs ( 25.0 ms per token, 40.0 tokens per second)

This reads as: full GPU offload, an 8k context, the ChatML template, about 40 tokens per second.

Small tests

  • Truncation test. Put a secret word at the start of a long prompt, pad past the window, and ask for the word. If the model cannot answer, the start was cut.
  • Template test. Ask a plain question. Stray special tokens or endless output point to a wrong template.
  • Repeat test. Run the same prompt twice at low temperature; large differences suggest a settings problem.

Before and after

Weak: "It answered, so it works." Later the team learns the model had run on the CPU at 3 tokens per second all week.

Better: save the first log and the speed number in the project README, and compare them after any upgrade.

What goes wrong

  • Silent truncation. No error appears when input exceeds the window.
  • A fallback to CPU after a driver update. Speed drops and nothing else tells you.
  • A wrong template. Quality looks like a weak model when the setup is the problem.

Examples

Reading a log

load_tensors: offloaded 20/33 layers to GPU
llama_context: n_ctx = 4096

Only 20 of 33 layers are on the GPU, so 13 run on the CPU and speed will be limited. The context is 4096, so a 6,000-token prompt will be cut. Fix with more VRAM headroom, a smaller quantization or a lower context.

Truncation test

Prompt: "The code word is PINEAPPLE." followed by about 10,000 tokens of unrelated text, then "What is the code word?" With a 4096-token window the model cannot know. A correct answer shows the window is large enough.

Key points

  • Read the startup log for layers offloaded, context length and chat template before trusting a setup.
  • In Ollama, ollama ps shows how much of the model is on the GPU and the loaded context.
  • A prompt longer than the context window is cut without an error, so test it with a word placed at the start.
  • Stray special tokens or rambling output often mean the chat template is wrong.
  • Record the first speed and settings as a baseline to compare after changes.

Common mistakes

  • Judging a setup by one friendly reply instead of the log.
  • Ignoring a partial offload line because the chat still works.
  • Blaming the model for bad answers when the chat template is wrong.
  • Assuming the context you asked for is the context the server loaded.

Check yourself · 2 of 3

You ask a model about a word placed at the start of a very long prompt. It answers wrongly with no error. What is the most likely cause?

Choose one answer

Check yourself · 3 of 3

A new model replies with stray tokens like <|im_end|> and keeps rambling. What do you check first?

Choose one answer

Practice items, not counted towards your mastery.

Start here