Before giving a model a long document, check what it was built with. ollama show prints the model details, including its parameters, template, and license, and the API show endpoint returns the same information as JSON.
What you need
- Ollama installed with a model pulled, for example llama3.2
- A terminal on the same machine
- The exact model name from ollama ls
Step 1: Show the model details
Run ollama show llama3.2. The output lists parameters such as num_ctx and temperature, the model template, and the license. A custom model built from a Modelfile shows the values that Modelfile set.
Step 2: Check the running context
Run ollama ps while the model is loaded. The CONTEXT column shows the context length actually allocated, which is the number that decides how much of a long prompt fits.
Step 3: Compare with the default
The Modelfile default context is 2048 tokens. If the model shows a larger num_ctx, it came from a custom Modelfile; if a task needs more, build a new model with PARAMETER num_ctx set higher.
Worked example: inspect llama3.2
The table below is a synthetic example. The commands and the 2048 default come from the Ollama docs; the values are illustrative.
| Check | Command | Expected result |
|---|---|---|
| Details | ollama show llama3.2 | Parameters and template listed |
| Context | ollama ps | CONTEXT column shows a number |
| Default | num_ctx | 2048 unless changed |
Expected result (UNTESTED). ollama show lists the model parameters including num_ctx, and ollama ps shows the allocated context for a running model. This check was not run live; the commands and default come from the cited Ollama docs.
Limits
- ollama show reports the model as built; a running model may use a different context if overridden per request.
- The context window caps the prompt plus the reply together.
- A larger context needs more KV cache memory.
- Model names must match exactly, including the tag.
