The Open Model EcosystemLesson 14 of 71

Module 2 · The map, and how to read it

Models that write code

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 4 of 10 in this chapter

This chapter’s goalPlace any open release on a map of families, modalities, formats and serving options within ten minutes (naming its licence posture, its likely tokenizer, the tools that will serve it and the size class it competes in) and pick the right kind of model for a retrieval, code, speech or generation task rather than reaching for a chat model by reflex.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Two different jobs, two different models

Code models split into two kinds that people constantly confuse, and using the wrong one is the most common reason a local coding assistant feels broken.

Completion models finish the code around the cursor. They are trained with fill-in-the-middle, which means the file is cut into prefix, suffix and middle, and the model learns to produce the middle given both sides. The prompt is not a conversation; it is special tokens:

Text
<|fim_prefix|>def parse_date(s):
    <|fim_suffix|>
    return dt<|fim_middle|>

Instruct models answer questions about code and write whole functions from a description. They expect a chat template, and asking one to do inline completion produces an explanation, an apology, and three code fences when what you wanted was four tokens.

If your editor plugin feels wrong, check which of these you have loaded. Every serious code family ships both, and the base or -Base suffixed repository is usually the one with fill-in-the-middle support.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Maths You Actually Need exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘Models that write code’, in The Open Model Ecosystem. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/open-models/open-code-models (Accessed: 29 November 2026).