Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Large language model code completion for Emacs
| Date | Stars |
|---|---|
| 2026-07-31 | 752 |
| 2026-08-06 | 750 |
Today
-2 stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Emacs Copilot
https://github.com/jart/emacs-copilot/assets/49262/1a79d4e4-9622-452e-9944-950c6f21d67f
The `copilot-complete` function demonstrates that ~100 lines of LISP
is all it takes for Emacs to do that thing Github Copilot and VSCode
are famous for doing except superior w.r.t. both quality and freedom
Emacs Copilot helps you do pair programming with a local-running LLM
that generates code completions within Emacs buffers. The LLM is run
as a sub-command that remembers your local editing history on a file
by file basis. Tokens stream into your buffer without delay as gen'd
and you can hit `C-g` to interrupt your LLM at any time. History and
memory can also be deleted from the LLM's context when deleting code
from your Emacs buffer that matches up verbatim. Copilot is language
agnostic and your programming language is determed by file extension
One really good LLM right now is WizardCoder 34b since it scores the
same as GPT-4 on HumanEval. You need a computer like a Mac Studio M2
Ultra in order to use it. If you have a mere Macbook Pro, then try the
Q3 version. If you have a modest PC then you could consider downloading
the WizardCoder-Python-13b llamafile since it's almost as good, and will
even go acceptably fast on CPU-only systems having at least AVX2 and
2200 MT/s RAM. If you're even more strapped for compute and use things
like Raspberry Pi, then give Phi-2 a spin
To get started, try writing yourself the first line of a function. For
example, you might open up a file in your editor named `hello.c` and
then type:
```c
bool is_prime(int x) {
```
Then place your caret at the end of the line, and press `C-c C-k` to
hand over control to your LLM, which should generate the rest of the
function implementation for you. Things are also tuned so the LLM is
likely to stop as soon as a function is made. Explanations and other
kind of ELI5 commentary is avoided too.
Later on, if you were to write something like this:
```c
int main() {
for (int i = 0; i < 100;
```
And ask your LLM to complete that, then your LLM will likely recall
that you two wrote an is_prime() function earlier, even though it's
only considering those two lines in the current instruction. You'll
most likely then see it decide to generate code to print the primes
## Reference Implementation
If you've downloaded your LLM (see below) then all you really need is to
copy and paste this code into an Emacs buffer and run `M-x eval-buffer`.
You'll want to tune the code to your own personal taste. That's why it's
being presented in full as a succinct code example here.
```elisp
(defun copilot-complete ()
(interactive)
(let* ((spot (point))
(inhibit-quit t)
(curfile (buffer-file-name))
(cash (concat curfile ".cache"))
(hist (concat curfile ".prompt"))
(lang (file-name-extension curfile))
;; extract current line, to left of caret
;; and the previous line, to give the llm
(code (save-excursion
(dotimes (i 2)
(when (> (line-number-at-pos) 1)
(previous-line)))
(beginning-of-line)
(buffer-substring-no-properties (point) spot)))
;; create new prompt for this interaction
(system "\
You are an Emacs code generator. \
Writing comments is forbidden. \
Writing test code is forbidden. \
Writing English explanations is forbidden. ")
(prompt (format
"[INST]%sGenerate %s code to complete:[/INST]\n```%s\n%s"
(if (file-exists-p cash) "" system) lang lang code)))
;; iterate text deleted within editor then purge it from prompt
(when kill-ring
(save-current-buffer
(find-file hist)
(dotimes (i 10)
(let ((substring (current-kill i t)))
(when (and substring (string-match-p "\n.*\n" substring))
(goto-char (point-min))
(while (search-forward substring nil t)
Excerpt of 11,610 characters
Read on GitHubJustin Tunney · United States
5
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:d3c3b06cb8c3078a, desc:code completion