Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.0.19 instead.
Reason given by maintainers: bug

Twitter Follow Discord Follow Stable Version License

🧙‍♂️ Mentat ⚡

It is by will alone I set my mind in motion

The Mentat Mantra

The Mentats of Dune combine human creativity with computer-like processing - and now you can too.


Mentat is the AI tool that assists you with any coding task, right from your command line.

Unlike Copilot, Mentat coordinates edits across multiple locations and files. And unlike ChatGPT, Mentat already has the context of your project - no copy and pasting required!

Want help understanding a new codebase? Need to add a new feature? Refactor existing code? Mentat can do it!

🍿 Example Videos (🔊 on!)

https://github.com/AbanteAI/mentat/assets/128252497/35b027a9-d639-452c-a53c-ef019a645719

See more videos on Twitter or YouTube:

⚙️ Setup

Installation and Setup Demonstration Video

Install

Before installing, it's suggested that you create a virtual environment to install it in:

# Python 3.10 or higher is required
python3 -m venv .venv
source .venv/bin/activate

Note that you'll have to have activated the virtual environment to run mentat if you install it there.

There are then 3 install methods. The first two will just let you run it:

  • PyPI: python -m pip install mentat
  • Github: python -m pip install git+https://github.com/AbanteAI/mentat.git

The third option is useful if you'd also like to modify Mentat's code, as well as run it:

git clone https://github.com/AbanteAI/mentat.git
cd mentat

# install with pip in editable mode:
pip install -e .

Add your OpenAI API Key

You'll need to have API access to GPT-4 to run Mentat. There are a few options to provide Mentat with your OpenAI API key:

  1. Create a .env file with the line OPENAI_API_KEY=<your-api-key> in the directory you plan to run mentat in or in ~/.mentat/.env
  2. Run export OPENAI_API_KEY=<your key here> prior to running Mentat
  3. Place the previous command in your .bashrc or .zshrc to export your key on every terminal startup

Configuration

For custom configuration options see configuration.md

(Optional) Install universal ctags

Installing universal ctags is helpful if you want to use Mentat with many files. This enables Mentat to better understand your code by building a map of your entire codebase.

See the official instructions for installing univeresal ctags for your specific operating system, however you may be able to install a compatible version with one of the following commands:

OSX

brew update && brew install universal-ctags

Ubuntu

sudo apt update && sudo apt install universal-ctags

Windows

choco install universal-ctags

🚀 Usage

Run Mentat from within your project directory. Mentat uses git, so if your project doesn't already have git set up, run git init. Then you can run Mentat with:

mentat <paths to files or directories>

List the files you would like Mentat to read and edit as arguments. Mentat will add each of them to context, so be careful not to exceed the GPT-4 token context limit. To add multiple files at once, you can also provide directories as arguments. When a directory is provided, Mentat will add all the contained files, except for ones ignored in your .gitignore. In addition to files and directories, you can use glob patterns to add multiple files at once.

Options

Exclude Files

Exclude given paths, directories, or glob patterns from Mentat's context. Takes precedence over included file paths.

mentat path/to/directory --exclude exclude_me.py dir1/dir2 **/*.ts

👩‍💻 Roadmap and Contributing

We welcome contributions! To coordinate, make sure to join the Discord server: Discord Follow

The goal for Mentat is to become the best way to write code. Some big improvements coming up are:

  • improved user interface and options (VSCode and other editor integrations, etc)
  • use with LLMs other than GPT-4
  • seamlessly work with codebases much larger than LLM context limits, without requiring users to filter files manually
  • improved edit quality

If this is something you'd like to work on, jump right in! And if you want to join the team to work on this full time, message @bio_bootloader on twitter.

To find something specific to work on, take a look at open issues and/or check this Github Project: Mentat Development

Metadata

Release files for mentat 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mentat 0.1.18
File Size Uploaded Provenance Actions
mentat-0.1.18.tar.gz 74.7 kB Without provenance Details for mentat-0.1.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mentat 0.1.18
File Interpreter ABI Platform Actions
mentat-0.1.18-py3-none-any.whl Python 3 none any Details for mentat-0.1.18-py3-none-any.whl

Total release size: 196.5 kB

Release files / mentat-0.1.18.tar.gz

Download URL mentat-0.1.18.tar.gz
Size 74.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7922f3db20db9be6103899cf05c56e29e91315509fd7efb1c64120272aa03703
BLAKE2b-256 checksum
How to use checksums
45b50e2aedb0b354d608ee9a792abd785929fa1b45fd3edfd99c4a6d0bfc6152
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / mentat-0.1.18-py3-none-any.whl

Download URL mentat-0.1.18-py3-none-any.whl
Size 121.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39de9d5f28ce632893bb0d5813afefdb74784b3b61a53fe1a9d727580d08f7b5
BLAKE2b-256 checksum
How to use checksums
613f47a100a9b71ae3c455e358eabec5653be56c8f67e8249b91ce85271ed49c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for mentat 0.1.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page