Back to guides

NeoVim Setup Guide

Configure NeoVim AI plugins to use your own AI subscriptions through KorProxy

1Overview

NeoVim has a rich ecosystem of AI-powered plugins for code completion, chat, and refactoring.

KorProxy provides an OpenAI-compatible endpoint at localhost:1337/v1 that works with popular plugins like avante.nvim, ChatGPT.nvim, and others.

This guide covers configuration for the most popular NeoVim AI plugins using Lua.

2Prerequisites

  • KorProxy app installed and running
  • NeoVim 0.8+ installed
  • A plugin manager (lazy.nvim, packer.nvim, etc.)
  • At least one provider authenticated in KorProxy

3Plugin Configurations

avante.nvim

A powerful AI assistant plugin with chat and code actions. Add to your lazy.nvim config:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  opts = {
    provider = "openai",
    openai = {
      endpoint = "http://localhost:1337/v1",
      model = "claude-sonnet-4-5-20250929",
      api_key_name = "cmd:echo korproxy",
    },
  },
}

ChatGPT.nvim

Interactive ChatGPT interface for NeoVim:

{
  "jackMort/ChatGPT.nvim",
  event = "VeryLazy",
  config = function()
    require("chatgpt").setup({
      api_host_cmd = "echo http://localhost:1337",
      api_key_cmd = "echo korproxy",
      openai_params = {
        model = "gpt-5.1-codex",
      },
    })
  end,
  dependencies = {
    "MunifTanjim/nui.nvim",
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim",
  },
}

codecompanion.nvim

AI-powered coding companion with inline and chat modes:

{
  "olimorris/codecompanion.nvim",
  config = function()
    require("codecompanion").setup({
      adapters = {
        korproxy = function()
          return require("codecompanion.adapters").extend("openai", {
            url = "http://localhost:1337/v1/chat/completions",
            env = {
              api_key = "korproxy",
            },
            schema = {
              model = {
                default = "claude-sonnet-4-5-20250929",
              },
            },
          })
        end,
      },
      strategies = {
        chat = { adapter = "korproxy" },
        inline = { adapter = "korproxy" },
      },
    })
  end,
}

Alternative: Environment Variables

Many plugins also respect standard environment variables. Add to your shell config:

# ~/.zshrc or ~/.bashrc
export OPENAI_API_BASE="http://localhost:1337/v1"
export OPENAI_API_KEY="korproxy"

4Selecting Models

Available Models

Use any supported model name—KorProxy routes to the appropriate provider. See the full model list.

claude-sonnet-4-5-20250929

Anthropic (balanced)

gpt-5.1-codex

OpenAI (standard)

gemini-2.5-flash

Google (fast)

claude-haiku-4-5-20251001

Anthropic (fast)

5Troubleshooting

Common Issues

  • 1

    Connection refused

    Check that KorProxy is running—look for the status indicator in the menu bar

  • 2

    Authentication errors

    Verify the provider is authenticated in KorProxy for the model you're using

  • 3

    Plugin not finding endpoint

    Some plugins require restart after config changes. Run :Lazy sync or restart NeoVim

  • 4

    curl/HTTP errors

    Ensure curl is installed and accessible. Test with curl http://localhost:1337/health

Next Steps