Cursor level of AI assistance for Sublime Text. I mean it.
Works with all OpenAI'ish API: llama.cpp server, ollama or whatever third party LLM hosting.

video sped up to 1.7x
video sped up to 1.7x
Package Control: Install Package.OpenAI and press Enter.ChatGPT mode works the following way:
OpenAI: Chat Model Select or OpenAI: Chat Model Select With Tabs commands.OpenAI: Open in Tab.OpenAI: Refresh Chat.OpenAI: Reset Chat History command to rescue.Note
You suggested to bind at least OpenAI: New Message, OpenAI: Chat Model Select and OpenAI: Show output panel in sake for convenience, you can do that in plugin settings.
You can separate a chat history and assistant settings for a given project by appending the following snippet to its settings:
{
"settings": {
"ai_assistant": {
"cache_prefix": "your_project_name"
}
}
}You can add a few things to your request:
To perform the former just select something within an active view and initiate the request this way without switching to another tab, selection would be added to a request as a preceding message (each selection chunk would be split by a new line).
To send the whole file(s) in advance to request you should super+button1 on them to make all tabs of them to become visible in a single view group and then run [New Message|Chat Model] with Sheets command as shown on the screen below. Pay attention, that in given example only README.md and 4.0.0.md will be sent to a server, but not a content of the AI chat.

Note
It's also doesn't matter whether the file persists on a disc or it's just a virtual buffer with a text in it, if they're selected, their content will be send either way.
Image handle can be called by OpenAI: Handle Image command.
It expects an absolute path to image to be selected in a buffer or stored in clipboard on the command call (smth like /Users/username/Documents/Project/image.png). In addition command can be passed by input panel to proceed the image with special treatment. png and jpg images are only supported.
Note
Currently plugin expects the link or the list of links separated by a new line to be selected in buffer or stored in clipboard only.
Phantom is the overlay UI placed inline in the editor view (see the picture below). It doesn't affects content of the view.
"prompt_mode": "phantom" for AI assistant in its settings.OpenAI: New Message or OpenAI: Chat Model Select and ask whatever you'd like in popup input pane.ctrl+c to stop prompting same as with in panel mode.
Important
Yet this is a standalone mode, i.e. an existing chat history won't be sent to a server on a run.
Note
A more detailed manual, including various assistant configuration examples, can be found within the plugin settings.
Warning
The following in buffer commands are deprecated and will be removed in 5.0 release.
append, replace, insert. They're quite self-descriptive. They should be set up in assistant settings to take effect.OpenAI: New Message."url" setting of a given model to point to whatever host you're server running on (e.g."http://localhost:8080")."token" if your provider required one."chat_model" to a model of your choice and you're set.Warning
Due to a known issue, a token value of 10 or more characters is currently required even for unsecured servers. More details here.
Note
You can set both url and token either global or on per assistant instance basis, thus being capable to freely switching between closed source and open sourced models within a single session.
The OpenAI Completion plugin has a settings file where you can set your OpenAI API key. This is required for the most of providers to work. To set your API key, open the settings within Preferences -> Package Settings -> OpenAI -> Settings and paste your API key in the token property, as follows:
{
"token": "sk-your-token",
}Warning
Due to a known issue, a token value of 10 or more characters is currently required even for unsecured servers. More details here.
To disable advertisement you have to add "advertisement": false line into an assistant setting where you wish it to be disabled.
You can bind keys for a given plugin command in Preferences -> Package Settings -> OpenAI -> Key Bindings. For example you can bind "New Message" including active tabs as context command like this:
{
"keys": [ "super+k", "super+'" ],
"command": "openai", // or "openai_panel"
"args": { "files_included": true }
},It just works.
Important
It's highly recommended to install the MultimarkdownEditing package to apply broader set of languages with syntax highlighting.
You can setup it up by overriding the proxy property in the OpenAI completion settings like follow:
"proxy": {
"address": "127.0.0.1", // required
"port": 9898, // required
"username": "account",
"password": "sOmEpAsSwOrD"
}Important
If any of your assistants are configured with a "token" of less than 10 characters, they will always fail to establish a connection, even if the server does not require authentication at all. Instead, the plugin will produce the following error message:
"No API token provided, you have to set the OpenAI token into the settings to make things work."
Luckily you'll find a quick and easy workaround here until a fix can be released!
Warning
All selected code will be sent to the OpenAI servers (if not using custom API provider) for processing, so make sure you have all necessary permissions to do so.
Note
This one was initially written at 80% by a GPT3.5 back then. I was there mostly for debugging purposes, rather than digging in into ST API. This is a pure magic, I swear!