---
name: watsonx-code-assistant-cloud-setup-wca-individual
title: Using watsonx Code Assistant Individual with a local IBM Granite model
description: '[watsonx Code Assistant Individual]'
last-updated: 2025-10-29
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/watsonx-code-assistant?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Using watsonx Code Assistant Individual with a local IBM Granite model
{: #cloud-setup-wca-individual}

[watsonx Code Assistant Individual]{: tag-warm-gray}


For individual users, watsonx Code Assistant can access a local model through [Ollama](https://ollama.com){: external}, which is a widely used local inferencing engine for large language models. Ollama wraps the underlying model-serving project [llama.cpp](https://github.com/ggml-org/llama.cpp).

For increased performance and a full set of features for your organization, provision a trial of watsonx Code Assistant on IBM Cloud. For more information, see [Setting up your watsonx Code Assistant service in IBM Cloud](https://cloud.ibm.com/docs/watsonx-code-assistant?topic=watsonx-code-assistant-cloud-setup-wca&format=markdown).
{: note}

## Install the watsonx Code Assistant extension
{: #cloud-setup-wca-individual-install-extension}

You can set up Ollama for use within Microsoft Visual Studio Code.

This setup is not available for the Eclipse IDE plug-in. It is only available with the Visual Studio Code extension.
{: note}

1. Open the [watsonx Code Assistant](https://marketplace.visualstudio.com/items?itemName=IBM.wca-core){: external} page in the Visual Studio Marketplace.
1. Click **Install** on the Marketplace page.
1. In Visual Studio Code, click **Install** on the extension.
1. In the extension settings, set **Wca: Backend Provider** to **ollama**.
   
   **Note for IBM employees**: Changing the backend provider will always revert to `wcaCore` if you are an IBM or Red Hat employee using the internal WCA@IBM extension. To enable changing the backend provider:
   - In the WCA@IBM extension settings, clear **Enable WCA@IBM mode for watsonx Code Assistant**
   - As an alternative, disable the WCA@IBM extension

## Install Ollama
{: #cloud-setup-wca-individual-install-ollama}

- Download and run the [ollama installer](https://ollama.com/download){: external}.
- On macOS, you can also use [Homebrew](https://brew.sh/){: external} to install Ollama:

   ```shell
   brew install ollama
   ```

## Start the Ollama inference server
{: #cloud-setup-wca-individual-start-ollama}

In a console window, run:

```shell
ollama serve
```

Leave that window open while you use Ollama.

If you receive the message `Error: listen tcp 127.0.0.1:11434: bind: address already in use`, the Ollama server is already started.

## Install the IBM Granite code model
{: #cloud-setup-wca-individual-install-granite}

Get started by installing the `granite-code:8b` model available in the [Ollama library](https://ollama.com/library/granite-code).

1. Open a new console window.

1. On the command line, type `ollama run granite-code:8b` to download and deploy the model. You see output similar to the following example:

   ```shell
   pulling manifest 
   pulling 8718ec280572... 100% ▕███████████████████████ 4.6 GB
   pulling e50df8490144... 100% ▕███████████████████████ ▏  123 B
   pulling 58d1e17ffe51... 100% ▕███████████████████████▏  11 KB
   pulling 9893bb2c2917... 100% ▕███████████████████████▏  108 B
   pulling 0e851433eda0... 100% ▕███████████████████████▏  485 B
   verifying sha256 digest 
   writing manifest 
   removing any unused layers 
   success 
   >>> 
   ```

1. Type `/bye` after the `>>>`to exit the Ollama command shell.

1. Try out the model by typing:

   ```shell
   ollama run granite-code:8b "How do I create a python class?"
   ```

1. You should see a response similar to:

   ```shell
   To create a Python class, you can define a new class using the "class" keyword followed by the name of the class and a colon. Inside the class definition, you can specify the methods and attributes that the class will have. Here is an example: ...
   ```

## Configure the Ollama host
{: #cloud-setup-wca-individual-configure-host}

By default, the Ollama server runs on IP address `127.0.0.1`, port `11434`, and http as a protocol. If you change the IP address or the port where Ollama is available:

1. In Visual Studio Code, open the extension settings for watsonx Code Assistant.

1. In **Wca > Local: API Host**, add the host IP and port.

## Configure the Granite model to use
{: #cloud-setup-wca-individual-configure-granite}

By default, watsonx Code Assistant uses the `granite-code:8b` model for both chat and code completion. If your environment has enough capacity, install the `granite-code:8b-base` model.

To use a different model:
1. Install the `granite-code:8b-base` model. See [Install the IBM Granite code model](#cloud-setup-wca-individual-install-granite).

1. In Visual Studio Code, open the extension settings for watsonx Code Assistant.

1. In **Wca > Local: Code Gen Model**, enter `granite-code:8b-base`.

## Securing your setup
{: #cloud-setup-wca-individual-secure-setup}

By default, the Ollama server runs on IP address 127.0.0.1, port 11434, using http as a protocol, on your local device. To use https instead, or go through a proxy server, see the [Ollama documentation](https://docs.ollama.com/faq#how-can-i-use-ollama-with-a-proxy-server){: external}.

## Switch from a local model to IBM Cloud
{: #cloud-setup-wca-individual-switch-to-cloud}

You might decide to switch from a local model to use a service instance on IBM Cloud. You can then configure Visual Studio Code to switch from a local model to IBM Cloud.

For more information, see [Setting up your watsonx Code Assistant service in IBM Cloud](https://cloud.ibm.com/docs/watsonx-code-assistant?topic=watsonx-code-assistant-cloud-setup-wca&format=markdown). 

To update your Visual Studio Code editor to use IBM Cloud instead of Ollama:

1. Quit Visual Studio Code.

1. Quit the Ollama application.

1. Start Visual Studio Code, then open watsonx Code Assistant. You should see the message `Ollama is not running in your IDE.`

1. Click `Switch to watsonx Code Assistant on IBM Cloud`.

For an alternative method, you can change the extension settings:

1. In Visual Studio Code, open the extension settings for watsonx Code Assistant.

1. In **Wca: Backend Provider**, switch from `ollama` to `wcaCore`.

1. Restart extensions to apply the change.