Send selected text from Notepad++ to any LLM backend and replace (or
augment) the selection with the model's reply. Supports OpenAI,
Anthropic Claude, Ollama, LM Studio, AnythingLLM, Groq, OpenRouter,
Azure OpenAI, vLLM / LocalAI / LiteLLM — anything that speaks
OpenAI-compatible chat completions, plus Claude's /v1/messages and
Ollama's native /api/generate natively.
Shortcut: ⌘⇧O.
Originally ported from the Krazal/nppopenai Windows plugin; renamed to NppLLM because the plugin can drive any backend, not just OpenAI.
- macOS 11.0+ (arm64 or x86_64 — universal binary)
- Notepad++ for macOS v1.0.4 or later
| Backends | OpenAI, Azure OpenAI, Anthropic Claude, Ollama, LM Studio / vLLM / LocalAI / AnythingLLM / any OpenAI-compatible endpoint |
| Streaming | Reply text streams into the editor as tokens arrive |
| Chat mode | Optional conversation history with configurable window size |
| Multi-prompt | Define named [Prompt:...] sections in an instructions file; plugin asks which to use per request |
| Thinking tags | <think>…</think> blocks from reasoning models can be kept or hidden |
| Keep-my-question | Keep the original prompt text alongside the reply, or replace it entirely |
| Dark mode aware | Sheets follow the system appearance |
cd /path/to/NppLLM
mkdir build && cd build
cmake ..
make -j$(sysctl -n hw.ncpu)
make install # → ~/.notepad++/plugins/NppLLM/Restart Notepad++; the plugin appears under Plugins → NppLLM.
If you previously ran the older NppOpenAI build of this plugin,
your NppOpenAI.ini and NppOpenAI_instructions files are
automatically renamed on first load of NppLLM — your API key and
prompts carry over.
On first run the plugin writes a default config file to
~/.notepad++/plugins/Config/NppLLM.ini. Open it from the menu
(NppLLM → Edit Config) and set the active [API] section. The
default file includes ready-to-copy comment blocks for every
supported backend (OpenAI, Claude, Ollama, LM Studio, AnythingLLM,
Groq, OpenRouter, Azure, vLLM/LocalAI). Replace the [API] block
with whichever one you want, save the file, and the plugin picks it
up automatically — no restart needed.
[API]
secret_key = sk-proj-your-key
api_url = https://api.openai.com/v1/
route_chat_completions = chat/completions
response_type = openai
model = gpt-4o-mini
streaming = 1[API]
secret_key = sk-ant-your-key
api_url = https://api.anthropic.com/v1/
route_chat_completions = messages
response_type = claude
model = claude-sonnet-4-6
max_tokens = 4096
streaming = 1brew install ollama && brew services start ollama
ollama pull qwen2.5:3b[API]
secret_key =
api_url = http://localhost:11434/
route_chat_completions = api/generate
response_type = ollama
model = qwen2.5:3b
streaming = 1[API]
secret_key = anythingllm-api-key-from-Tools-Developer-API
api_url = http://localhost:3001/api/v1/openai/
route_chat_completions = chat/completions
response_type = openai
model = my-workspace
streaming = 1~/.notepad++/plugins/Config/NppLLM_instructions holds either a
single free-form system prompt (file body = prompt text) or multiple
named prompts:
[Prompt:Translator]
You are a translator. Translate the user's text to French.
[Prompt:Code Reviewer]
You are a senior engineer performing a thorough code review.
When multiple prompts are defined, a picker sheet appears each time you press ⌘⇧O.
| Menu item | Shortcut | Action |
|---|---|---|
| Ask OpenAI | ⌘⇧O | Send selection, stream reply into editor |
| Edit Config | — | Open NppLLM.ini in the editor |
| Edit Instructions | — | Open (and create if missing) the prompts file |
| Reload Config | — | Manual reload (rarely needed — save auto-reloads) |
| Keep my question | — | Toggle whether the original question stays in the document |
| Chat Settings… | — | Toggle chat mode + set history limit |
| About NppLLM | — | Version / credits |
cd tests
clang++ -std=c++17 -Wall -I../src \
../src/PromptManager.cpp \
../src/RequestFormatters.cpp \
../src/ResponseParsers.cpp \
../src/StreamParser.cpp \
test_core.cpp -o test_core
./test_coreExpected: 78 passed, 0 failed. Coverage includes prompt-file parsing
edge cases (empty, UTF-8 BOM, UTF-16 rejection, CRLF, multi-prompt),
per-backend request JSON shapes (incl. gpt-5 max_completion_tokens
and Claude auto-default max_tokens), response parsing for every
backend (incl. multi-part Claude content, multi-line Ollama bodies,
<think> stripping, orphan-tag loop safety, malformed-JSON surface),
and streaming decode (OpenAI SSE, Claude SSE, Ollama JSONL,
split-across-chunk lines, byte-by-byte delivery, [DONE] /
finish_reason / message_stop terminations, malformed-chunk skip).
| File | Purpose |
|---|---|
PluginMain.mm |
Plugin ABI, 10 menu commands, askChatGPT orchestration |
ConfigManager.{h,mm} |
INI parse/write, wire-compatible with Windows NppOpenAI schema |
PromptManager.{h,cpp} |
Parse [Prompt:…] instructions file |
EditorHelpers.{h,mm} |
Scintilla wrappers (selection, replace, undo-grouping) |
HTTPClient.{h,mm} |
NSURLSession blocking + streaming POST with main-thread marshaling + cancellation |
RequestFormatters.{h,cpp} |
Per-backend JSON body construction |
ResponseParsers.{h,cpp} |
Per-backend response extraction, <think> stripping |
StreamParser.{h,cpp} |
SSE + JSONL decoder with partial-line buffering |
LoaderSheet.{h,mm} |
Progress sheet with cancel + elapsed-time counter |
ChatSettingsSheet.{h,mm} |
Chat mode + history-limit sheet |
PromptPickerSheet.{h,mm} |
Multi-prompt picker sheet |
- Wire-compatible INI schema with the Windows NppOpenAI plugin — you can copy INI files between platforms. Only the file name changes (NppLLM.ini vs NppOpenAI.ini); the keys and sections are identical.
- Shortcut: ⌘⇧O on macOS maps to the same command ID as Ctrl+Shift+O on Windows.
- Status-bar messages: the macOS host (v1.0.4) doesn't implement
NPPM_SETSTATUSBAR; per-request timing / token-count messages silently no-op. All user-facing output still appears in the editor and via alert sheets. - Streaming thread safety: every chunk is marshaled via
dispatch_async(dispatch_get_main_queue(), …)before touching Scintilla, which is main-thread-only on macOS.
GPL, same as the upstream Windows plugin.