# CodeCompanion - Documentation

> Supercharge Your Neovim Workflow with Novita AI and CodeCompanion.nvim.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/guides/codecompanion

# CodeCompanion

Supercharge Your Neovim Workflow with Novita AI and CodeCompanion.nvim.

CodeCompanion.nvim is a lightweight yet powerful Neovim plugin that connects advanced language models (LLMs) directly to your editor, enabling developers to work smarter and faster. With built-in support for Novita AI’s state-of-the-art models, this integration transforms your workflow by offering intelligent code suggestions, automated debugging, and streamlined refactoring tools.
In this comprehensive guide, we’ll walk you through the step-by-step process of setting up Novita AI with CodeCompanion.nvim. Learn how to optimize your Neovim setup and unlock the full power of AI-assisted coding for faster, smarter development.

##

[​](#how-to-leverage-novita-ai-with-codecompanion-nvim)

How to Leverage Novita AI with CodeCompanion.nvim

You can find the GitHub repository of CodeCompanion.nvim here: [olimorris/codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim).

###

[​](#step-1-generate-your-novita-ai-api-key)

Step 1: Generate Your Novita AI API Key

- [Log in](https://novita.ai/user/login) to your Novita AI account.

- Access the [Key Management Page](https://novita.ai/settings/key-management).

- Create a new API key and copy it for later use.

###

[​](#step-2-select-a-model)

Step 2: Select a Model

- Visit the[Novita AI Model Library](https://novita.ai/models).

- Choose a model that suits your needs (e.g., `meta-llama/llama-3.1-8b-instruct`).

- Note down the model name.

###

[​](#step-3-configure-codecompanion)

Step 3: Configure CodeCompanion

We assume you have already installed the Neovim, and if not, you can install it by referring to the [Neovim Installation Guide](https://github.com/neovim/neovim/blob/master/INSTALL.md).

- Open your [Neovim](https://neovim.io/) configuration file (`init.lua` or equivalent).

The Neovim configuration file is typically located at: `~/.config/nvim/init.lua` (for macOS or Linux). And you can create this directory and file if they don’t exist yet.

- Install the CodeCompanion plugin.

You can install the plugin by referring to the [CodeCompanion.nvim Installation Guide](https://codecompanion.olimorris.dev/installation.html).

- Add the following setup for CodeCompanion in your Neovim configuration file:

```
require("codecompanion").setup({
adapters = {
novita = {
base_url = "https://api.novita.ai/openai",
api_key = "", -- Replace with your actual API key
model = "meta-llama/llama-3.1-8b-instruct" -- Replace with your chosen model
}
}
})
```

- Save and reload Neovim.

###

[​](#step-4-verify-integration)

Step 4: Verify Integration

- Run the following command in Neovim:

```
:checkhealth codecompanion
```

- Ensure all dependencies are installed and configured correctly.

###

[​](#step-5-test-novita-ai-features)

Step 5: Test Novita AI Features

- Open a code file in Neovim and start using CodeCompanion.nvim features such as inline suggestions or chat-based assistance.

- For example:

Use shortcuts to trigger intelligent code completions.

- Start a chat session by invoking `:CodeCompanionChat` for interactive problem-solving.

Last modified on September 1, 2025
