Skip to main content

Which model for the agent?

The agent sidebar is more demanding than a normal chat. It does not only answer: it reads your diagram, calls tools, reads their answers and edits the diagram step by step, sometimes ten or twenty times for one request. Not every model can do this, and a model that can needs enough room to remember what it has read.

The short answer​

MinimumRecommended
Modelsupports tool calling, about 20B parameters or moreQwen3.8 27B, Gemma 4 26B or a comparable current model; a large cloud model is fine, mind privacy
Context window16,384 tokens (16k)32,768 tokens (32k), more for large diagrams and long chats
Maximum answer length (max tokens)8,19216,384 for models that think before they answer
Memorywhat the model needs plus some GB for the contexta 27B model in 5 to 8 bit quantisation takes roughly 20 to 30 GB of GPU or unified memory

The usual default of 8,192 tokens is too small. The first request of the agent already carries its instructions and the description of all its tools (about 6,000 characters of instructions plus the tool list), and every answer of a tool is added to it. With 8k the model server refuses the request, or it may drop the beginning of it.

What the context window is​

The context window is the model's working memory: everything it sees in one request, counted in tokens (roughly three quarters of a word). It holds, in this order:

  1. the instructions of the agent and the list of its tools,
  2. your conversation so far,
  3. the diagram text of the diagram you have open (a large diagram is summarised first and read in parts),
  4. every answer of every tool the agent called for this request,
  5. the room the model needs for its own answer, including its thinking.

A request that reads a diagram, validates it and makes two edits easily reaches 8,000 to 15,000 tokens. That is why 16k is the lowest sensible value and 32k leaves room for larger diagrams, e-mail templates and long chats. A bigger window costs additional memory and makes every step a little slower, so do not set it far beyond what you need.

Settings​

Ollama. Cocosplate sends the context size with every request, so it overrides what the model itself defaults to. Open the system settings, open your Ollama endpoint and set:

FieldDefault of a new endpointSet it to
Context window (tokens)32768at least 16384, better 32768
Maximum answer length (tokens)81928192, with a model that thinks first 16384

An endpoint you created with an older version keeps its stored value of 8192 / 4096: raise it once.

llama.cpp. The window is fixed when the server starts: llama-server --ctx-size 32768 .... Careful with --parallel: the window is divided between the parallel slots, so --ctx-size 32768 --parallel 2 gives each request only 16k. For one agent at a time use --parallel 1. Start the server with --jinja, otherwise tool calls are not understood.

Other services (OpenAI-compatible, cloud). The window is a property of the model; nothing to set. Pick a model with tool calling and at least 32k.

Which models​

Use a current model of about 20 to 30 billion parameters or larger with tool calling. In our experience Qwen3.8 27B is the safest local choice; Gemma 4 26B is quicker per step but makes more mistakes when it has to repair or restructure a diagram. Both are fit for daily work. Models below about 14 billion parameters tend to produce wrong or half finished diagrams; use them for simple requests (explain, rename, add one step). A large cloud model works as well, mind the privacy of your data.

A model must support tool calling. With Ollama, ollama show <model> lists tools under capabilities. Models that only complete text, and embedding models, cannot drive the agent.

Hints for a model that runs on a second computer (for example a Mac in your network):

  • Pick one model and stay with it. Switching between large models makes the server unload and reload them, which takes minutes and can run it out of memory.
  • A slow computer needs a longer Time limit in the agent settings (see below) and a longer timeout of the endpoint.

When something goes wrong​

What you seeUsuallyWhat to do
"the prompt is longer than the context length" or an error 400context window too smallraise the Context window of the endpoint to 16384 or 32768
"The model's answers were cut off at the output limit" or "The model gave no final answer"the model used up its answer length for thinkingraise the Maximum answer length of the endpoint to 16384, or use a model that thinks less
The agent stops in the middle with "I reached the iteration limit"the request needs more steps than allowedpress Continue or raise Max rounds in the agent settings
The agent stops after the time limitslow model, large requestraise Time limit in the agent settings, or split the request
It keeps reading the same thing, or forgets what it has just readwindow too small (the start of the conversation is cut off) or a model without good tool supportraise the window; try another model
The result is wrong although the agent says it is donethe model is too small for the taskask it to validate and read the diagram back; undo the request in the change list and ask for a smaller step

Getting more out of a smaller model​

  • Open the diagram first and say "repair this diagram" or "add a decision after the first step". The agent works on what you see; you do not have to name it.
  • Ask for one thing per request. Several small requests are cheaper, more reliable and easier to undo than one big one.
  • Name what must stay: "keep the buttons of the input mask as they are".
  • Look at the change list after each request and undo the request that went wrong; the model does not learn from it but the next request starts clean.
  • Start a new chat when you change topic: a long conversation fills the window with things that no longer matter.
  • Max rounds and Time limit are in the settings of the sidebar, side by side. Raise them when the agent stops too early, not before.

Further reading​