Home

Awesome

QodeAssist - AI-powered coding assistant plugin for Qt Creator

Discord Build plugin GitHub Downloads (all assets, all releases) GitHub Tag Static Badge Static Badge

qodeassist-icon QodeAssist is an AI-powered coding assistant plugin for Qt Creator. It provides intelligent code completion and suggestions for C++ and QML, leveraging large language models through local providers like Ollama. Enhance your coding productivity with context-aware AI assistance directly in your Qt development environment.

Table of Contents

  1. Overview
  2. Installation
  3. Configure Plugin
  4. Supported LLM Providers
  5. Recommended Models
  6. QtCreator Version Compatibility
  7. Development Progress
  8. Hotkeys
  9. Troubleshooting
  10. Support the Development
  11. How to Build

Overview

<details> <summary>Code completion: (click to expand)</summary> <img src="https://github.com/user-attachments/assets/255a52f1-5cc0-4ca3-b05c-c4cf9cdbe25a" width="600" alt="QodeAssistPreview"> </details> <details> <summary>Multiline Code completion: (click to expand)</summary> <img src="https://github.com/user-attachments/assets/c18dfbd2-8c54-4a7b-90d1-66e3bb51adb0" width="600" alt="QodeAssistPreview"> </details> <details> <summary>Chat with LLM models in side panels: (click to expand)</summary> <img src="https://github.com/user-attachments/assets/ead5a5d9-b40a-4f17-af05-77fa2bcb3a61" width="600" alt="QodeAssistChat"> </details> <details> <summary>Chat with LLM models in bottom panel: (click to expand)</summary> <img width="326" alt="QodeAssistBottomPanel" src="https://github.com/user-attachments/assets/4cc64c23-a294-4df8-9153-39ad6fdab34b"> </details>

Installation

  1. Install Latest QtCreator
  2. Install Ollama. Make sure to review the system requirements before installation.
  3. Install a language models in Ollama via terminal. For example, you can run:

For standard computers (minimum 8GB RAM):

ollama run qwen2.5-coder:7b

For better performance (16GB+ RAM):

ollama run qwen2.5-coder:14b

For high-end systems (32GB+ RAM):

ollama run qwen2.5-coder:32b
  1. Download the QodeAssist plugin for your QtCreator.
  2. Launch Qt Creator and install the plugin:
    • Go to MacOS: Qt Creator -> About Plugins... Windows\Linux: Help -> About Plugins...
    • Click on "Install Plugin..."
    • Select the downloaded QodeAssist plugin archive file

Configure Plugin

QodeAssist comes with default settings that should work immediately after installing a language model. The plugin is pre-configured to use Ollama with standard templates, so you may only need to verify the settings.

  1. Open Qt Creator settings (Edit > Preferences on Linux/Windows, Qt Creator > Preferences on macOS)
  2. Navigate to the "Qode Assist" tab
  3. On the "General" page, verify:
    • Ollama is selected as your LLM provider
    • The URL is set to http://localhost:11434
    • Your installed model appears in the model selection
    • The prompt template is Ollama Auto FIM
  4. Click Apply if you made any changes

You're all set! QodeAssist is now ready to use in Qt Creator.

Supported LLM Providers

QodeAssist currently supports the following LLM (Large Language Model) providers:

Recommended Models:

QodeAssist has been thoroughly tested and optimized for use with the following language models:

Model Types

FIM models (codellama:7b-code, starcoder2:7b, etc.) - Optimized for code completion and suggestions

Instruct models (codellama:7b-instruct, starcoder2:instruct, etc.) - Better for chat assistance, explanations, and code review

For best results, use FIM models with code completion and Instruct models with chat features.

Ollama:

For autocomplete(FIM)

ollama run codellama:7b-code
ollama run starcoder2:7b
ollama run qwen2.5-coder:7b-base
ollama run deepseek-coder-v2:16b-lite-base-q3_K_M

For chat and instruct

ollama run codellama:7b-instruct
ollama run starcoder2:instruct
ollama run qwen2.5-coder:7b-instruct
ollama run deepseek-coder-v2

Template-Model Compatibility

TemplateCompatible ModelsPurpose
CodeLlama FIMcodellama:codeCode completion
DeepSeekCoder FIMdeepseek-coder-v2, deepseek-v2.5Code completion
Ollama Auto FIMAny Ollama base modelCode completion
Qwen FIMQwen 2.5 modelsCode completion
StarCoder2 FIMstarcoder2 base modelCode completion
Alpacastarcoder2:instructChat assistance
Basic ChatMessages without tokensChat assistance
ChatMLQwen 2.5 modelsChat assistance
Llama2llama2 model family, codellama:instructChat assistance
Llama3llama3 model familyChat assistance
Ollama Auto ChatAny Ollama chat modelChat assistance

Note:

QtCreator Version Compatibility

Development Progress

Hotkeys

Troubleshooting

If QodeAssist is having problems connecting to the LLM provider, please check the following:

  1. Verify the IP address and port:

  2. Check the endpoint:

Make sure the endpoint in the settings matches the one required by your provider - For Ollama, it should be /api/generate - For LM Studio and OpenAI compatible providers, it's usually /v1/chat/completions

  1. Confirm that the selected model and template are compatible:

Ensure you've chosen the correct model in the "Select Models" option Verify that the selected prompt template matches the model you're using

If you're still experiencing issues with QodeAssist, you can try resetting the settings to their default values:

  1. Open Qt Creator settings
  2. Navigate to the "Qode Assist" tab
  3. Pick settings page for reset
  4. Click on the "Reset Page to Defaults" button
    • The API key will not reset
    • Select model after reset

Support the development of QodeAssist

If you find QodeAssist helpful, there are several ways you can support the project:

  1. Report Issues: If you encounter any bugs or have suggestions for improvements, please open an issue on our GitHub repository.

  2. Contribute: Feel free to submit pull requests with bug fixes or new features.

  3. Spread the Word: Star our GitHub repository and share QodeAssist with your fellow developers.

  4. Financial Support: If you'd like to support the development financially, you can make a donation using one of the following:

    • Bitcoin (BTC): bc1qndq7f0mpnlya48vk7kugvyqj5w89xrg4wzg68t
    • Ethereum (ETH): 0xA5e8c37c94b24e25F9f1f292a01AF55F03099D8D
    • Litecoin (LTC): ltc1qlrxnk30s2pcjchzx4qrxvdjt5gzuervy5mv0vy
    • USDT (TRC20): THdZrE7d6epW6ry98GA3MLXRjha1DjKtUx

Every contribution, no matter how small, is greatly appreciated and helps keep the project alive!

How to Build

Create a build directory and run

cmake -DCMAKE_PREFIX_PATH=<path_to_qtcreator> -DCMAKE_BUILD_TYPE=RelWithDebInfo <path_to_plugin_source>
cmake --build .

where <path_to_qtcreator> is the relative or absolute path to a Qt Creator build directory, or to a combined binary and development package (Windows / Linux), or to the Qt Creator.app/Contents/Resources/ directory of a combined binary and development package (macOS), and <path_to_plugin_source> is the relative or absolute path to this plugin directory.

For Contributors

QML code style: Preferably follow the following guidelines https://github.com/Furkanzmc/QML-Coding-Guide, thank you @Furkanzmc for collect them C++ code style: check use .clang-fortmat in project

qodeassist-icon qodeassist-icon-small