Skip to main content

EigenGen is a CLI LLM frontend for code generation with support for claude, gpt4 and llama3.1:70b.

Project description

EigenGen

EigenGen is a CLI Large Language Model frontend. It is designed for working with code. EigenGen uses a two-stage process where larger LLM is used to solve the task and produce dense output, which is then given to a smaller LLM which applies the changes and produces the complete file output. Finally this is then used to produce diffs which the user can choose to apply.

Supported Models

EigenGen currently works correctly with:

  • OpenAI o1-preview, o1-mini, GPT4o (/meld by gpt-4o-mini)
  • Anthropic claude-3-5-sonnet (uses same model for /meld operation, haiku has too low output token limit)
  • llama3.2:90b via Groq (/meld by llama3.1-70b-versatile)
  • Google Gemini 1.5 pro 002 (/meld by gemini-1.5-flash-002 )
  • Mistral Large v2 (/meld uses the same)

Note: Mistral Large seems to have some trouble working with the EigenGen prompting. Similar issues happen with all Mistral models regardless of size. Perhaps they require some distinctly different approach.

Features

  • Basic prompt/answer flow with -p "Type your prompt here".
  • --chat mode allows discussing the changes and when the assistant answers with code blocks of changes, they can be applied with '/meld' command.
  • Add 'git ls-files' files to context automatically with -g, filtered by .eigengen_ignore.
  • eigengen -g --index creates an index cache in ~/.eigengen/cache for semi-automatic context detection. When using -g switch after creating the index, eigengen includes any locally modified files as determined by git plus any files listed with -f argument, and then further adds those files that reference symbols defined in this list of files.

Installation

pip install eigengen

You must export your API key using:

export ANTHROPIC_API_KEY=<your-api-key>
or
export OPENAI_API_KEY=<your-api-key>
or
export GROQ_API_KEY=<your-api-key>
or
export GOOGLE_API_KEY=<your-api-key>
or
export MISTRAL_API_KEY=<your-api-key>

Tips

  • In addition to eigengen executable, we provide egg as well. It's shorter.
  • EigenGen uses EDITOR environment variable to pick the text editor.
  • Combining the two, for Sublime Text you can: alias egg='EDITOR="subl -w" egg -m gpt4'
  • Or if you're into VSCode: alias egg='EDITOR="code -w" egg -m gpt4'.
  • Vim/Neovim/Emacs users can probably figure out their own solutions.
  • Paths above are for Linux. MacOS and Windows binaries may not be in PATH, so you need to find them first.

Development

Please install in edit mode like this:

python3 -m venv .venv
. .venv/bin/activate
pip install -e .

For testing install pytest.

Example Usage

# start a new chat pre-filling initial message from the command line
eigengen -g --chat -p "Please implement a TODO-list web app using react + javascript, thank you. Provide the full project directory structure, please. It should allow adding, editing and deleting entries."

By default eigengen uses claude-3-5-sonnet. In order to use OpenAI GPT4o model, please give --model, -m argument like this:

eigengen -m gpt4 -p "your prompt content"

Work In Progress

  • Exploring user interaction concepts

TODO:

  • Add progress indicator as the LLM calls can take a very long time

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eigengen-0.2.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eigengen-0.2.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file eigengen-0.2.0.tar.gz.

File metadata

  • Download URL: eigengen-0.2.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for eigengen-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5f96a0e092ce94b443ebec9c536e1691804d9535e1f30aa1e3fc6fe488be7c71
MD5 1fb16607922ae8f007c46fcb66e509c9
BLAKE2b-256 faf548f25416bb40a6e0e6efde8680d2b6ef9b75dae6aeafac54b9798bfb42f5

See more details on using hashes here.

File details

Details for the file eigengen-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eigengen-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for eigengen-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75943035ffafc80f31449e863e9f5e709e674a7abe8440b0d01cc5d392920b27
MD5 650b5787d925d5d3b29850d82882535f
BLAKE2b-256 eaea23432e3b222c35b79e2c99763c9b2b0ff42f9541e8b76611fe17528919c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page