← All AI model types

Code model

A language model trained heavily on source code to complete, write, explain and fix programs.

What it is

Code models are language models whose training mix leans heavily on source code, commit history and technical writing. They power autocomplete in editors, chat about a codebase, and coding agents that edit files and run tests.

How it works

Training includes code in many languages plus objectives such as fill-in-the-middle, so the model can complete a gap between existing lines. Instruction tuning and reinforcement learning against unit tests teach it to produce code that actually runs.

What it is good for

  • Autocomplete in the editor
  • Generating functions and tests
  • Explaining or refactoring unfamiliar code
  • Coding agents that work across a repository

Limits to know

  • Can produce plausible code with subtle bugs or security issues
  • May suggest outdated library APIs
  • Output still needs review and tests

Well-known examples