{"id":29061661,"url":"https://github.com/mjrusso/wingman","last_synced_at":"2026-05-18T17:09:14.401Z","repository":{"id":301371463,"uuid":"1008739660","full_name":"mjrusso/wingman","owner":"mjrusso","description":"Emacs package for LLM-assisted code/text completion","archived":false,"fork":false,"pushed_at":"2025-07-31T11:18:58.000Z","size":2166,"stargazers_count":25,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-31T15:10:27.657Z","etag":null,"topics":["copilot","developer-tool","emacs","emacs-package","llama","llm"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjrusso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.org","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-26T02:59:37.000Z","updated_at":"2025-07-31T11:18:58.000Z","dependencies_parsed_at":"2025-07-31T13:15:58.141Z","dependency_job_id":"999ca961-d54e-4337-9e3d-f7488bcf2ff7","html_url":"https://github.com/mjrusso/wingman","commit_stats":null,"previous_names":["mjrusso/wingman"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mjrusso/wingman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjrusso%2Fwingman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjrusso%2Fwingman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjrusso%2Fwingman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjrusso%2Fwingman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjrusso","download_url":"https://codeload.github.com/mjrusso/wingman/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjrusso%2Fwingman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33184848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copilot","developer-tool","emacs","emacs-package","llama","llm"],"created_at":"2025-06-27T08:03:14.537Z","updated_at":"2026-05-18T17:09:14.396Z","avatar_url":"https://github.com/mjrusso.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  wingman.el - LLM-assisted text completion\n\nWingman brings GitHub Copilot-style inline completions to Emacs, offering two powerful modes: fast, automatic completions via a local (or remote) [llama.cpp](https://github.com/ggml-org/llama.cpp) server, in addition to manual completions through any backend supported by [gptel](https://github.com/karthink/gptel).\n\n_This package is, primarily, a direct port of the excellent [llama.vim plugin](https://github.com/ggml-org/llama.vim) (see [technical design details](https://github.com/ggml-org/llama.cpp/pull/9787) for more background on how this works)._\n\n![logo](./assets/logo.png)\n\n### Features\n\n* **Inline \"Ghost Text\" Completions:** Suggestions appear directly in your buffer as you type.\n* **Dual Completion Modes:**\n  - **Native FIM:** Fast, efficient completions via `llama.cpp`'s specialized `/infill` endpoint for \"fill-in-the-middle\" (FIM) models. By default, these completions appear automatically as you type.\n  - **Emulated FIM:** Access a broader range of models via `gptel`. These completions must always be manually triggered.\n* **Local First:** No code leaves your machine when using a self-hosted `llama.cpp` server with the _Native FIM_ completion model.\n* **Asynchronous by Default:** Never blocks your editing while waiting for a completion.\n* **Response Caching:** Repeated requests for the same context are answered instantly from an in-memory cache.\n* **Project-Aware Context:** Uses a ring buffer of text chunks from recently used files (scoped to the [current project](https://www.gnu.org/software/emacs/manual/html_node/emacs/Projects.html)) to provide more relevant suggestions.\n\n## Prerequisites\n\nThis package requires a running [llama.cpp](https://github.com/ggml-org/llama.cpp) server instance, accessible at `wingman-llama-endpoint`.\n\nAdditionally, to use the _Emulated FIM_ completion mode, you must configure [gptel](https://github.com/karthink/gptel) accordingly for each LLM provider you intend to use.\n\n## Installation\n\n### With `use-package` and `straight.el`\n\n```emacs-lisp\n(use-package wingman\n  :straight (:type git :host github :repo \"mjrusso/wingman\")\n```\n\nNote that this package depends on [transient](https://github.com/magit/transient) and [gptel]((https://github.com/karthink/gptel)), which will be installed automatically if necessary.\n\n### Manual Installation\n\nClone this repository:\n\n```bash\ngit clone https://github.com/mjrusso/wingman.git ~/.emacs.d/lisp/wingman\n```\n\nAdd then add the directory to your Emacs `load-path`:\n\n```emacs-lisp\n(add-to-list 'load-path \"~/.emacs.d/lisp/wingman\")\n(require 'wingman)\n```\n\nNote that dependencies ([transient](https://github.com/magit/transient) and [gptel]((https://github.com/karthink/gptel)) must also be manually installed in this case.\n\n## Configuration\n\nThe behaviour of Wingman can be customized through its customization group (`M-x customize-group RET wingman RET`), or by setting variables in your `init.el`.\n\nA minimal configuration:\n\n```emacs-lisp\n(use-package wingman\n  :straight (:type git :host github :repo \"mjrusso/wingman\")\n\n  ;; Enable wingman-mode in all programming modes\n  :hook (prog-mode . wingman-mode))\n```\n\nAn example of a more advanced configuration:\n\n```emacs-lisp\n(use-package wingman\n  :straight (:type git :host github :repo \"mjrusso/wingman\")\n  :ensure t\n  :defer t\n\n  :init\n\n  (setq wingman-prefix-key (kbd \"C-c w\"))\n\n  :hook (prog-mode . wingman-mode)\n\n  :config\n\n  (setq wingman-log-level 4)\n  (setq wingman-ring-n-chunks 16)\n\n  ;; default llama.cpp server port is 8012\n  (setq wingman-llama-endpoint \"http://127.0.0.1:8080/infill\")\n\n  ;; assumes use of Modus Themes; substitute with preferred color scheme\n  (set-face-attribute 'wingman-overlay-face nil\n                      :foreground  (modus-themes-get-color-value 'red-warmer)\n                      :background  (modus-themes-get-color-value 'bg-inactive))\n\n  ;; don't provide completions in files that typically contain secrets\n  (add-to-list 'wingman-disable-predicates\n               (lambda ()\n                 (or (derived-mode-p 'envrc-file-mode)\n                     (derived-mode-p 'direnv-envrc-mode)\n                     (when buffer-file-name\n                       (let ((fname (file-name-nondirectory buffer-file-name)))\n                         (or (string-equal \".env\" fname)\n                             (string-equal \".envrc\" fname)\n                             (string-prefix-p \".localrc\" fname)))))))\n\n  :bind\n  (:map wingman-mode-prefix-map\n   (\"TAB\" . wingman-fim)              ; Request Native FIM\n   (\"S-TAB\" . wingman-fim-emulated)   ; Request Emulated FIM\n   (\"d\" . wingman-fim-debug))\n\n   :map wingman-mode-completion-transient-map\n   (\"TAB\" . wingman-accept-full)\n   (\"S-TAB\" . wingman-accept-line)\n   (\"M-S-TAB\" . wingman-accept-word)))\n```\n\n## Usage\n\n1. **Enable the mode:** `wingman-mode` is a buffer-local minor mode. You can enable it with `M-x wingman-mode`, or globally in all applicable buffers with `global-wingman-mode`. (Alternatively, you may enable `wingman-mode` automatically via the hook as shown in the configuration examples above.)\n\n2. **Get Completions:**\n   * **Native FIM (`wingman-fim`):**\n     * If `wingman-auto-fim` is `t` (the default), completions will appear automatically as you type using the configured `llama.cpp` server.\n     * To manually request a completion from the configured `llama.cpp` server, use `M-x wingman-fim` (bound to `C-c w TAB` in the example config).\n   * **Emulated FIM (`wingman-fim-emulated`):****\n     * This is always triggered manually. Use `M-x wingman-fim-emulated` (bound to `C-c w S-TAB` in the example config).\n     * Once triggered, a `transient` menu will appear, letting you choose from your configured `gptel` backends and models. Select one to send the request.\n\n3. **Accept a Completion:**\n   * **Full:** Press the \"accept full\" key (default: `\u003ctab\u003e`) to insert the entire suggestion.\n   * **Line:** Press the \"accept line\" key (default: `S-TAB`) to insert only the first line of the suggestion.\n   * **Word:** Press the \"accept word\" key (default: `M-S-TAB`) to insert only the first word.\n\n4. **Dismiss a Completion:**\n   * Keep typing, or\n   * Move the cursor, or\n   * Press the manual trigger key again.\n\n## Appendix\n\n### llama.cpp setup\n\n#### Mac OS\n\n```bash\nbrew install llama.cpp\n```\n\n#### Windows\n\n```bash\nwinget install llama.cpp\n```\n\n#### Other OS\n\nInstall from your preferred package manager, build from source, or use the [latest binaries](https://github.com/ggml-org/llama.cpp/releases).\n\n### llama.cpp settings\n\n[Recommended settings](https://github.com/ggml-org/llama.vim/blob/master/README.md#llamacpp-settings), depending on the amount of available VRAM:\n\n- More than 16GB VRAM:\n\n  ```bash\n  llama-server --fim-qwen-7b-default\n  ```\n\n- Less than 16GB VRAM:\n\n  ```bash\n  llama-server --fim-qwen-3b-default\n  ```\n\n- Less than 8GB VRAM:\n\n  ```bash\n  llama-server --fim-qwen-1.5b-default\n  ```\n\nNote that a [FIM (\"fill-in-the-middle\")-compatible model](https://huggingface.co/collections/ggml-org/llamavim-6720fece33898ac10544ecf9) is required.\n\n### gptel setup\n\nTo use _Emulated FIM_ mode, configure `gptel` backends as per [the setup instructions](https://github.com/karthink/gptel?tab=readme-ov-file#setup).\n\n## Acknowledgements\n\nThis project is a direct port of [llama.vim](https://github.com/ggml-org/llama.vim) to Emacs.\n\nAlso see: [copilot.el](https://github.com/copilot-emacs/copilot.el) and [emacs-copilot](https://github.com/jart/emacs-copilot) for alternative approaches and inspiration.\n\n## License\n\nThis project is licensed under the GPL-3.0-or-later License. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjrusso%2Fwingman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjrusso%2Fwingman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjrusso%2Fwingman/lists"}