Palm1r / QodeAssist

QodeAssist is an AI-powered coding assistant plugin for Qt Creator
GNU General Public License v3.0
52 stars 3 forks source link
ai autocomplete codeassist llm lmstudio local ollama openai private qtcreator

QodeAssist - AI-powered coding assistant plugin for Qt Creator

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

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

Code completion: (click to expand) QodeAssistPreview
Chat with LLM models in side panels: (click to expand) QodeAssistChat
Chat with LLM models in bottom panel: (click to expand) QodeAssistBottomPanel

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 suggestions:

ollama run codellama:7b-code

For chat:

ollama run codellama:7b-instruct
  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

Configure plugins: (click to expand) Configuere QodeAssist
  1. Open Qt Creator settings
  2. Navigate to the "Qode Assist" tab
  3. Select "General" page
  4. Choose your LLM provider (e.g., Ollama)
  5. Select the installed model by the "Select Model" button
    • For LM Studio you will see current loaded model
  6. Choose the prompt template that corresponds to your model
  7. Apply the settings

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

ko-fi

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:

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

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

LM Studio:

similar models, like for ollama

Please note that while these models have been specifically tested and confirmed to work well with QodeAssist, other models compatible with the supported providers may also work. We encourage users to experiment with different models and report their experiences.

If you've successfully used a model that's not listed here, please let us know by opening an issue or submitting a pull request to update this list.

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

  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:

    • ko-fi
    • 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