Skip to content
Krazal edited this page Feb 7, 2025 · 13 revisions

Welcome to the NppOpenAI FAQ!

Below I’ve tried to collect Frequently Asked Questions related to the plugin and possible solutions


Question: I’ve an old, buggy NppOpenAI release! How should I update?

Answer: If the latest NppOpenAI release is newer than the available version in Notepad++ » Plugins » Plugins Admin, you may try installing the latest version manually.

  1. Open Notepad++ and click ? menu » About Notepad++ (F1)
  2. Check out if you’re using the 32-bit or 64-bit version of N++ (see the image below)
  3. Download the appropriate NppOpenAI ZIP file from the latest release, e.g.:
  4. Close Notepad++
  5. Unzip the files to the plugin folder, e.g. C:\Program Files (x86)\Notepad++\plugins\NppOpenAI\ with overwriting the existing ones
  6. Try to reopen Notepad++

If you get an error message and/or Notepad++ crashes, please try to remove the NppOpenAI.ini config file and/or create an empty NppOpenAI_instructions file (without extension) with UTF-16 LE BOM encoding (last option in the Encoding menu).

Notepad++ About window


Q: [TIP] How can I use OpenAI to e.g. optimize my code, translate the selected text etc.?

A: Use instructions! Click Plugins » NppOpenAI » Edit Instructions and enter the required text e.g. “Please optimize the PHP code I send. Return the optimized code only.”

There are some useful scenarios:

Please translate the received text into english

Please create a PHP function based on the received text without other comments

Please recommend alternatives for the text you received


Q: How to fix OpenAI’s error response: “The model gpt-4 does not exist or you do not have access to it”?

A: This may probably caused by some misconfiguration.

  1. Open Plugins » NppOpenAI » Edit Config menu
  2. Update model setting. Currently recommended: model=gpt-4o-mini
  3. Save the NppOpenAI.ini file
  4. Load your settings: Plugins » NppOpenAI » Load Config

Q: What’s this warning: “The selected text is too long. Please select a text shorter than 2048 characters”?

A: Unfortunately this is a Notepad++ limitation (bug?) as described in #22 issue. However a workaround may work, if you enable chat (Plugins » NppOpenAI » Chat: off) and try to send your request in more steps (messages) completed with the appropriate instructions.


Q: How to fix OpenAI’s error response: “You exceeded your current quota…”?

A: Unfortunately OpenAI has a one-time “free tier” (trial?) mode which is available only for a few months after registration: https://community.openai.com/t/understanding-api-limits-and-free-tier/498517

However you may use Ollama or PrivateGPT on localhost, but their availability has not been tested directly with NppOpenAI. To configure NppOpenAI for local use please see the next question.


Q: Can I use localhost AI systems, like Ollama or PrivateGPT?

A: Officially these systems are not supported, but e.g. you can use a PHP proxy to handle requests and responses. For more information and example code see the #23 issue. For PrivateGPT use the 8001 port, like: $ollama_url = 'http://localhost:8001/v1/chat/completions'; — for more information see the Python SDK for PrivateGPT API.


Q: Does NppOpenAI support other plugins, like Python Script or NppExec?

A: Currently not, but a task has been added to the Project of the plugin.


Q: Does NppOpenAI support context (like previous paragraphs), multiple responses (choices) etc.?

A: No, it doesn’t, but a GUI (config) for better UX is planned, and I’ve some ideas in my mind. ;)