💻

Using a Free AI Coding Assistant in VS Code

Jul 1, 2024

Using a Free AI Coding Assistant in VS Code

Introduction

  • Demonstrates how to use a free AI coding assistant in VS Code.
  • Keeps code 100% local with free open-source models.
  • Potentially offers results as good as or better than a Co-pilot subscription.

Steps to Get Started

Download and Installation

  • Website: Start at ama.com.
  • Availability: Mac, Linux, Windows (Windows is preview).
  • *Installing Windows Preview:
    • Download and install.
    • May need to restart the computer for recognition.*

Verification

  • Open terminal in VS Code (Ctrl + `).
  • Command: olama then d-el to verify installation.
  • If not recognized, restart the computer.`

Choosing an AI Model

Evaluating Models

  • *Leaderboard Insight:
    • Displays base tests and eval plus tests.
    • Comparison between free, open-source models and some paid models.
  • *Top Models:
    • Code Quinn (Rank 5).
    • GP4, Deep Seek Coder V2, GP4 Turbo.

Selecting a Model

  • *Code Quinn:
    • Preferred for its smaller size (4.2 GB).
  • *Alternative Option:
    • Deep Seek Coder V2 (8.9 GB).
  • *Implementation:
    • Command: olama run code Quin in terminal.
    • Note: The download could take a while due to size.*

Setting Up Continue Extension in VS Code

Installation

  • Search: Continue extension in VS Code extension menu.
    • Also available for JetBrains.
  • *Installation Process:
    • Click and install.
    • Open and configure JSON config for continue.*

Configuration

  • *JSON Configuration:
    • Defaults to Llama 3.
    • Select Code Quinn under auto-detect.
  • *Custom Commands:
    • Example: add command to explain selected code step by step.

Custom Commands Example

  • **Creating New Commands:
    1. Command Name: step.
    2. Description: Explain selected code step by step.
    3. Highlight code and type step in chat to get explanation.

Chat Window Interaction

Writing Functions

  • *Example (JavaScript):
    • Create file named convert-to-mysql-timestamp.js.
    • Use chat to write and modify functions.*

Examples (Python)

  • **Creating REST API:
    • Generate code for FastAPI and SQLAlchemy using chat commands.

Conclusion

  • Tutorial wrap up.
  • Links to additional resources, blog post.
  • Shout-out to patrons and invitation to join Patreon.
  • Encouragement for feedback and continuous learning.