Configuring Ollama for Smart CodeInsight

From RAD Studio
Jump to: navigation, search

Go Up to Smart CodeInsight


RAD Studio plans to provide one or more pre-configured Docker images of Ollama with CodeLlama in upcoming releases for easier setup and integration. Meanwhile, you can follow the available public steps.

Note: An Ollama docker image can be installed on a dedicated Linux server and the Windows Linux subsystem (WLS). To help with configuration, you can consider using Docker Desktop. However, this tool is free and is only subject to a specific EULA: Larger organizations must pay a license. Please check this page for details.
Note: For Nvidia-GPU or AMD-GPU-enabled images, read the instructions here.

Below is a streamlined guide for installing, running, and using Ollama. Please follow the steps below.

Ensure your Docker installation

Ensure Docker installation in the following cases as suggested below.

Docker Desktop on Windows

  1. Verify Docker Desktop installation by searching it in the Start Menu.
  2. Check Docker Engine status by opening it.
  3. Verify the Docker Desktop Engine following PowerShell command:
    docker --version

Docker on WSL2

  1. Open a WSL2 terminal.
  2. Run the following command line.
    docker --version
  3. Check Docker Engine Status by executing:
    sudo service docker status
    Attention: The output should indicate that Docker is active (running).
  4. If Docker is not running, you can start it by executing the following command:
    sudo service docker start

Run and use Ollama

  1. Ensure your Docker installation and that the Docker engine is running.
  2. Open PowerShell or CMD and run the following command
    docker login
  3. Log in with your Docker Hub username and password.
  4. Install and run the Embarcadero image:
    docker run --name Embarcadero_Codellama -p 11434:11434 radstudio/codellama:latest
    Note: Please consider the following information when performing the steps above:
    • -name is wrong, and --name is correct with two dashes.
    • You can rename the container, but if you change 'Embarcadero_Codellama,' you must also update it in subsequent commands.
    • You can use any other port number, consider the format ‘-p 12345:54321’
      • Left Number (12345): This is the host port. It represents the port on your local machine (the machine running Docker) that you want to bind to the container.
      • Right Number (54321): This is the container port. It represents the port inside the Docker container that your application is listening on.
  5. Test Ollama in the command line (optional step)
    docker exec -it Embarcadero_Codellama ollama run codellama
    1. Ask any question and check its response.
    2. Exit chat mode using Ctrl + D or /bye.
    3. You can now close the command line
  6. For the IDE's Options page, use the following credentials: