DEV Community

Vivek0712
Vivek0712

Posted on

Experimenting with DeepSeek-R1 Model in VS Code Hosted via GitHub Models

Experimenting with DeepSeek-R1 Model in VS Code Using GitHub Models Platform

Introduction

AI-assisted development is revolutionizing how developers write and test code. GitHub Models provides a range of AI-powered tools that enhance workflows, including DeepSeek-R1, a text generation model. By integrating this model into Visual Studio Code (VS Code) using the AI Toolkit, developers can streamline coding tasks and improve productivity.

If you want to develop a generative AI application, you can use GitHub Models to find and experiment with AI models for free. Once you are ready to bring your application to production, you can switch to a token from a paid Azure account.

This guide outlines the setup process, model selection, and how to use DeepSeek-R1 effectively within VS Code.


Step 1: Installing the AI Toolkit in VS Code

The AI Toolkit for Visual Studio Code allows seamless interaction with generative AI models. To install it:

  1. Open VS Code and navigate to the Extensions Marketplace.
  2. Search for "AI Toolkit for Visual Studio Code".
  3. Click Install to add the extension.
  4. Once installed, click on the AI Toolkit icon in the Activity Bar to access the toolkit.

Image description


Step 2: Exploring the Model Catalog

Once authorized, you can browse and select models from the Model Catalog:

  1. Open AI Toolkit and click Open Model Catalog.
  2. Browse through the list of available models.
  3. Select DeepSeek-R1, a robust text generation model.
  4. Click Try in Playground under the DeepSeek-R1 model.

Image description

Step 3: Authorizing the AI Toolkit with GitHub

To access AI models hosted on GitHub, you must authorize the AI Toolkit:

  1. Click on AI Toolkit in the Activity Bar.
  2. A prompt will appear requesting you to sign in using GitHub.
  3. Click Allow to grant the necessary permissions.

Image description


Step 4: Using DeepSeek-R1 in the Playground

After selecting DeepSeek-R1, you can test it in the AI Playground:

  1. Enter a prompt, such as "Write me a simple HTML code to say Hi, bloggers!".
  2. Adjust inference parameters (e.g., response length) as needed.
  3. Click Run to generate a response.

Image description

Image description


Step 5: Implementing the Generated Code in VS Code

With the generated HTML snippet from DeepSeek-R1, you can integrate it into your project:

  1. Copy the generated HTML code.
  2. Create a new file in VS Code (e.g., deepseek.html).
  3. Paste the HTML code and save the file.
  4. Open the file in a browser to preview the output.

Image description

Image description


Conclusion

The AI Toolkit for Visual Studio Code simplifies interactions with AI models, enabling developers to integrate AI-powered functionalities into their workflows. DeepSeek-R1 assists in generating code snippets, automating tasks, and boosting productivity.

Explore different models available in GitHub Models and see how AI can optimize your coding process.

Happy coding! 🚀

Top comments (0)