ibm-granite/watsonx-code-assistant-individual
Captured source
source ↗ibm-granite/watsonx-code-assistant-individual
Description: For individual users, watsonx Code Assistant can access a local IBM Granite model
License: Apache-2.0
Stars: 37
Forks: 6
Open issues: 7
Created: 2024-08-30T21:48:40Z
Pushed: 2025-06-25T20:35:29Z
Default branch: main
Fork: no
Archived: no
README:
License
- The license for IBM watsonx Code Assistant Individual can be found in the [product-licenses](./product-licenses/) folder in this repository.
- You can use this repository to add issues for watsonx Code Assistant Individual. The license for issues, discussion, and any files or samples shared in issues can be found in the [LICENSE](./LICENSE) file.
IBM watsonx Code Assistant Individual
Features
Watsonx Code Assistant Individual is an innovative, lightweight AI coding companion built for IBM’s state-of-the-art Granite large language models. This companion offers robust, contextually aware AI coding assistance for popular programming languages such as C, C++, Go, Java, JavaScript, Python, and TypeScript. Seamlessly integrated into Visual Studio Code, watsonx Code Assistant Individual accelerates development productivity and simplifies coding tasks by providing powerful AI support hosted locally on the developer’s laptop or workstation using Ollama.
Chat with code models
- Chat with an IBM Granite code model to create code, and ask general programming questions.
- Use the chat to explain and extend existing code from your workspace.
Code completion
Complete the line that you're currently typing:
And even full methods and functions:
Turn comments into code
Create a comment that describes a function, method, or piece of logic in your editor, and have watsonx Code Assistant Individual create it.
Everything is local, configurable by you
- Install the granite 8b code instruct model for both chat and code completion.
- Optionally, install the granite 8b code base model for code completion.
- These models run locally on your laptop using Ollama.
Setup
Watsonx Code Assistant Individual accesses models through Ollama, which is a widely used local inferencing engine for LLMs. Ollama wraps the underlying model-serving project llama.cpp.
Install Ollama
MacOS, Linux, Windows: Download and run the ollama installer
If already installed, update Ollama to the latest stable version
If you have installed Ollama via package installer:
Ollama on macOS and Windows will automatically download updates. Click on the taskbar or menubar item, and then click "Restart to update" to apply the update. Updates can also be installed by downloading the latest version manually.
On MacOS, If you have installed Ollama via brew, run the command to upgrade:
brew upgrade ollama
On Linux, re-run the install script:
curl -fsSL https://ollama.com/install.sh | sh
Start the Ollama inference server
In a terminal window, run:
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. There's nothing else that you need to do.
Install the Granite code model
Get started with watsonx Code Assistant Individual by installing the granite-code:8b model available in the Ollama library.
1. Open a new terminal window. 2. On the command line, type ollama run granite-code:8b to download and deploy the model. You see output similar to the following example:
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 >>>
3. Type /bye after the >>>to exit the Ollama command shell. 4. Try the model by typing:
ollama run granite-code:8b "How do I create a python class?"
5. You should see a response similar to the following:
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: ...
Install the watsonx Code Assistant Individual Visual Studio Code extension
This setup is not available for the Eclipse IDE plug-in. It is only available with the Visual Studio Code extension.
1. Open the watsonx Code Assistant extension page in the Visual Studio Marketplace. 2. Click Install on the Marketplace page. 3. In Visual Studio Code, click Install on the extension.
Configure the Ollama host
By default, the Ollama server runs on IP address 127.0.0.1, port 11434, using http as a protocol. If you change the IP address or the port where Ollama is available:
1. Open the extension settings. 2. Locate the entry for _API Host_. 3. Add the host IP and port.
Configure the Granite models to use
By default, watsonx Code Assistant Individual uses the granite-code:8b model for both chat and code completion. If your environment has capacity, install the granite-code:8b-base model, and use it as _Local Code Gen Model_ as follows. To use a different model:
1. Install the granite-code:8b-base model. See [Install the Granite code model](#install-the-granite-code-model). 2. Open the extension settings. 3. Update the model name for either _Local Code Gen Model_ to granite-code:8b-base.
Securing your setup
Your Visual Studio Code environment
Watsonx Code Assistant Individual does not provide additional security controls. We recommended the following steps to properly secure your setup:
- Apply all Visual Studio Code updates to help ensure that you have the latest security and bug fixes. For more information, see the Microsoft Documentation.
- The watsonx Code Assistant Individual extension logs are stored in *.log files under
/.wca. These files are not encrypted, besides the encryption that your file system provides. Safeguard the logs against improper access.
Connecting watsonx Code Assistant…
Excerpt shown — open the source for the full document.
Notability
notability 3.0/10New repo, low stars, not traction