← all repositories
kootenpv/neural_complete

Neural networks writing neural networks, what could go wrong?

An LSTM autocomplete trained on Keras code that suggests whole lines of Python instead of just the next word.

1.2k stars Python Coding Assistants
neural_complete
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

What it does Neural Complete is a generative autocomplete that runs a small LSTM on your Python code. It was trained on 26 GitHub scripts containing Keras imports, and it suggests how to finish an entire line based on up to 80 previous characters (or 20 previous tokens, if you use the token-based model). The backend is a Flask server; the frontend is a thin Angular 2 layer.

The interesting bit The recursive gag is the point: a neural network helping you write neural network code. The demo shows it tracking context across lines—first suggesting model = Sequential(), later switching to model.add(...) when the variable already exists. The author openly admits the final line still contains mistakes.

Key highlights

  • Two models: character-level (completes mid-word) and token-level (semantic, but needs complete tokens)
  • Includes a GitHub scraping script to gather more training data, with a polite warning not to annoy GitHub’s API
  • Frontend dist folder is pre-built so you can skip Node dependencies
  • Built heavily on Keras’s standard LSTM text generation example

Caveats

  • Trained on only 26 scripts, so suggestions are rough; the README says you’d need “a lot more for a reasonable result”
  • No AST awareness yet, so variable naming confusion is still a problem
  • The author notes this is not yet the personal-script-autocompleter of the future

Verdict Grab it if you want a hackable, self-contained demo of generative code completion and don’t mind retraining from scratch. Skip it if you need production-grade autocomplete—this is a proof of concept with training wheels still on.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.