Integrate a private AI coding assistant into your CDE using Ollama, Continue, and OpenShift Dev Spaces

Learn how to set up a cloud development environment (CDE) using Ollama, Continue, Llama3, and Starcoder2 LLMs with OpenShift Dev Spaces for faster, more efficient coding.

Access the Developer Sandbox

Once you have registered for a Developer Sandbox for Red Hat OpenShift account, you can access Red Hat OpenShift Dev Spaces. 

In order to get full benefit from taking this lesson, you need to:

In this lesson, you will:

  • Access OpenShift Dev Spaces on the Developer Sandbox.
  • Start the cloud development environment.

Access Red Hat OpenShift Dev Spaces on the Developer Sandbox

Follow this link to get started with OpenShift Dev Spaces. This redirects you to the OpenShift Dev Spaces user dashboard (Figure 1).  

User dashboard.
Figure 1: Red Hat OpenShift Dev Spaces user dashboard.

Start the cloud development environment

On the User Dashboard, navigate to the Create Workspace tab and provide the URL to the repository that we will use for this activity: 

https://github.com/redhat-developer-demos/cde-ollama-continue

Then, click the Create & Open button (Figure 2). 

Starting cloud development environment.
Figure 2: Starting cloud development environment from GitHub URL.

During the workspace startup, you will be asked to authorize the GitHub OAuth app (Figure 3). 

GitHub OAuth.
Figure 3: GitHub OAuth for Dev Spaces on Developer Sandbox.

This allows users to have full Git access from the workspaces and execute commands like git push without any setup. Once the permissions are granted, the git-credentials-secret is created in the user namespace which stores the token that is used by Red Hat OpenShift Dev Spaces. 

Note: You can always revoke the access at any time on the User Dashboard via User Preferences → Git Services or directly from the GitHub settings.

Once the workspace is started, you will be asked if you trust the authors of the files in the workspace (Figure 4). Opt in by clicking the Yes, I trust the authors button.  

Warning pop-up.
Figure 4: Visual Studio Code - Open Source ("Code - OSS") warning pop-up.

After some seconds, the Continue extension will be automatically installed. 

Note: Continue is the leading open source AI code assistant. Learn more about the extension from the official documentation

When installation is complete, you can click the new symbol on the left in the sidebar, where a Welcome to Continue screen shows up. Because the Continue extension has already been preconfigured, you can scroll to the bottom of this page and click the Skip button (Figure 5).

Continue extension setup.
Figure 5: Continue extension setup.

Now you are ready to use the personal AI assistant (Figure 6).

Cloud development environment with Continue extension.
Figure 6: Cloud development environment with Continue extension.

In the next lesson, we’ll examine the devfile and explore some examples that illustrate the utility of a personal AI assistant.

Previous resource
Overview: Integrate a private AI coding assistant into your CDE using Ollama, Continue, and OpenShift Dev Spaces
Next resource
Understand the devfile and utility of a personal AI assistant