yaroslavyaroslav/OpenAI-sublime-text

First class Sublime Text AI assistant with gpt-5, Opus 4.6, Gemini 3 and ollama support!

OpenAI Sublime Text Plugin – Quick Overview

What it is – A Sublime Text extension that lets you talk to large‑language‑model APIs (OpenAI, Anthropic, Google Gemini, or any OpenAI‑compatible server such as llama.cpp, ollama, llmman) directly from the editor. It works at the cursor level, letting you send selected code, whole files, build‑output or LSP diagnostics as context and receive answers inline or in a chat panel.

Key capabilities

  • Chat mode with any model you configure (including the placeholder “gpt‑5”).
  • Multiple back‑ends – you point the plugin at a remote API URL and token; it supports the standard OpenAI chat endpoint, Anthropic, Gemini, and generic OpenAI‑compatible services.
  • Context handling – you can add individual files (or the whole project) to the request, include recent build or LSP output, and even send images (png/jpg) via a clipboard‑or‑path command.
  • Inline “Phantom” UI – model replies appear as non‑intrusive overlays inside the editor, with quick actions to copy, append, replace, open in a new tab, or add to history.
  • Chat history per project – separate histories and assistant settings can be stored per‑project via a cache_prefix.
  • Streaming & status bar – server‑sent‑events streaming is supported; the status bar shows model name, token counts, etc.
  • Proxy support and optional markdown rendering with syntax highlighting.

How you use it

  1. Install via Package Control or clone the repo into your Sublime Packages folder.
  2. Add your API key (or token) in Preferences → Package Settings → OpenAI completion.
  3. Open the Command Palette and run OpenAI: Chat Model Select to pick a model/assistant and output mode (Phantom or Chat view).
  4. Type a prompt (optionally select code) and hit Enter. The response appears inline or in a panel, and you can interact with it via the phantom buttons or key bindings you define.

Configuration highlights

  • openAI.sublime-settings holds the API URL, token, model name, temperature, proxy, and UI toggles.
  • You can toggle files for context via the command palette, tab context menu, or sidebar menu.
  • Build/LSP output inclusion is controlled by build_output_limit.
  • Advertising can be disabled per‑assistant with `

Related

  • Project
  • Project
  • Project
  • Project
  • Project