Local LLMs are excellent pair programmers. Here is a workflow to maximize their utility.
1. Explaining Legacy Code
Paste a complex function into the chat and ask:
"Explain this code line by line. Identify any potential edge cases or bugs."
2. Generating Unit Tests
Writing tests is tedious. Let the AI do it.
"Write Jest unit tests for the following TypeScript function. Include positive and negative test cases."
3. Refactoring
"Refactor this Python script to follow PEP 8 standards and improve variable naming for readability."
Recommended Models
- DeepSeek Coder V2: State of the art for coding.
- Qwen 2.5 Coder: Excellent all-rounder.
- StarCoder2: Good for code completion.