7  LLMs for Coding

Large Language Models (LLMs) can significantly enhance coding efficiency. They’re also a great tool for explaining code, which is helpful for learning Python.

7.1 Ways of using LLMs

LLMs for coding is an area under rapid development. Here are a few ways of using LLMs for coding, roughly in the order in which they became available for use:

  1. Chat interfaces via web (e.g. ChatGPT, Mistral AI)
  2. Chat interfaces via an IDE (e.g. GitHub Copilot Chat)
  3. Inline chat and autocompletion in IDE (e.g. GitHub Copilot)
  4. Agentic coding with specialized IDEs (e.g. Windsurf)

Using LLMs is completely optional for the course. However, since GitHub Copilot is free and integrated with VS Code, our suggestion is to try it out as a learning assistant.

7.2 Ideas of how to use LLMs in coding

A few ideas of how to use LLMs in coding:

  • Write scripts from scratch based on a description of what’s needed
  • Explain a given script line by line to enhance understanding
  • Understand cryptic error messages, and get potential solutions
  • Review the quality of your code to see if it could be improved

7.3 Example - Andrej Karpathy using LLMs for coding