Giter Site home page Giter Site logo

sorokinvld / mentat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abanteai/mentat

0.0 1.0 0.0 979 KB

Mentat - The AI Coding Assistant

Home Page: https://mentat.ai

License: Apache License 2.0

Python 96.37% CSS 0.88% Jinja 1.33% JavaScript 1.04% Shell 0.38%

mentat's Introduction

Twitter Follow Discord Follow Documentation Status 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!)

intro-to-mentat.mp4

See more videos on Twitter or YouTube:

โš™๏ธ Setup

Installation and Setup Demonstration Video

Install

It is recommended you install this package in a virtualenv:

# 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

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

If you want to use a models through Azure, Ollama or other service see this doc for details.

๐Ÿš€ 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.

For more information on commands, configuration or using other models see the documentation.

๐Ÿ‘ฉโ€๐Ÿ’ป 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.

mentat's People

Contributors

pcswingle avatar jakethekoenig avatar biobootloader avatar waydegg avatar granawkins avatar swinglejohn avatar dheerajck avatar a-joshi avatar yodon avatar chadwhitacre avatar rupurt avatar eltociear avatar laszlovandenhoek avatar vickunwu avatar nilshamerlinck avatar rogeriochaves avatar hesiod-au avatar xadhrit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.