Skip to content
CodeCompanion.nvim

Editors and IDE extensions

Use CodeCompanion.nvim with Shannon

Extend CodeCompanion's openai_compatible adapter with Shannon's URL and key, and its chat buffer, inline edits and @{agent} tools use Shannon models.

  • From the CodeCompanion.nvim docs, Nov 7, 2026
  • OpenAI Chat Completions
  • About 4 min

About CodeCompanion.nvim

CodeCompanion.nvim is a Neovim plugin for chatting with models in a buffer, editing code inline and running agents: with tool groups such as @{agent} the model reads and edits files and runs commands while you approve each step. Its openai_compatible adapter takes a URL, a key and a name, so it can run on Shannon models.

What you need

A Shannon API key
Keys & usage
Base URL
https://api.shannon-ai.com/v1 Endpoint: /v1/chat/completions
Every snippet below follows your choice.

Set it up

  1. Export your key

    The adapter's api_key names the environment variable, so the key never sits in your config.

    Shell
    export SHANNON_API_KEY=YOUR_API_KEY
  2. Add the Shannon adapter

    Extend openai_compatible under adapters.http. url is the host without /v1; the default chat_url and models_endpoint add /v1/chat/completions and /v1/models. Make it the adapter for chat, inline, cmd and background tasks.

    init.lua
    require("codecompanion").setup({
      adapters = {
        http = {
          shannon = function()
            return require("codecompanion.adapters").extend("openai_compatible", {
              formatted_name = "Shannon",
              env = {
                url = "https://api.shannon-ai.com",
                api_key = "SHANNON_API_KEY",
              },
              schema = {
                model = {
                  default = "Kimi-K3-uncensored-NVFP4",
                  choices = {
                    ["Kimi-K3-uncensored-NVFP4"] = { meta = { context_window = 1022976 } },
                  },
                },
              },
              opts = { vision = true },
            })
          end,
        },
      },
      interactions = {
        chat = { adapter = "shannon" },
        inline = { adapter = "shannon" },
        cmd = { adapter = "shannon" },
        background = { adapter = "shannon" },
      },
    })
  3. Open a chat

    Run :CodeCompanionChat. Add @{agent} to a message to let the model read, edit and run commands, approving each tool call.

Check that it works

Send: @{files} Create cat.py with a function that returns "meow".

You should see: CodeCompanion asks you to approve create_file, then cat.py exists.

Models that fit CodeCompanion.nvim

Every id below meets what CodeCompanion.nvim needs. The first one is the default in the snippets.

Model idContext windowMax outputImage input
Kimi-K3-uncensored-NVFP4 1,022,976 262,144 Yes
shannon-coder-1 131,072 65,536 No
Kimi-K3.1-Pro-uncensored-NVFP4 1,022,976 262,144 Yes
Kimi-K3-uncensored-3BIT-REAP 225,280 225,280 Yes
shannon-3 196,608 65,536 Yes

Model settings

CodeCompanion.nvim asks for these values. They follow the model you picked.

SettingValueWhy
meta.context_window 1022976 The model's window; compaction and editing triggers need it.

Good to know

  • Without api_key, the adapter sends OPENAI_API_KEY. Set it so no other key goes to Shannon.
  • The background adapter defaults to Copilot. Set interactions.background too, or chat titles and the tool judge fail without telling you.
  • Tools and images are on by default for openai_compatible; set opts.vision = false for models that do not read images.
  • For the Responses API, extend openai instead, with url = "https://api.shannon-ai.com/v1/responses".

Tips

  1. Press gd in the chat buffer to open the debug window and see exactly what goes to Shannon on the next turn.
  2. Give each model meta.context_window under choices; compaction at 85% of the window is skipped without it.
  3. Leave out choices to have CodeCompanion list every Shannon id from /v1/models; the list is cached for 30 minutes.
  4. @{agent} is CodeCompanion's agent mode with its own system prompt; @{files} gives the model file tools only.
  5. Press ga in a chat to change adapter or model without leaving the conversation.

Troubleshooting

SymptomCauseFix
404 Not Found env.url includes /v1, so the path is doubled. Use url = "https://api.shannon-ai.com".
401 Unauthorized SHANNON_API_KEY is not set in Neovim's environment, so another key or none is sent. Export it in your shell profile and restart Neovim.
401 Unauthorized The key is missing, mistyped or rotated. Copy the key again from Keys & usage; it starts with sk-.
context_length_exceeded / "prompt is too long" The conversation is longer than the model's window. Start a new chat, let the tool compact it, or pick a model with a larger window.
insufficient_quota Your balance cannot pay for the request. Top up or change plan; the request is not retried by itself.

Questions

Does CodeCompanion.nvim work with Shannon?

Yes, through an adapter that extends openai_compatible with env.url = "https://api.shannon-ai.com".

Can I add several Shannon models?

Yes: list them under schema.model.choices, or leave choices out to load the whole list, and switch with ga.

Choose your language

All languages are equal. Pick the one you want to browse in.

Europe

Middle East & North Africa

South Asia

Southeast Asia

East Asia

Central Asia & Caucasus

Africa

Oceania

Constructed & Classical