Skip to main content

An experiment in AI terminal interaction.

Project description

ModelProgrammer

ModelProgrammer (MP) is an experimental interactive AI-powered programmer and a supporting QT based conversation UI to enable fine tuning and development of large language models for linux terminal interaction.

Currently MP only supports OpenAI's ChatGPT 3 model but ideally it will support others (including open weight models) in the future.

Long Term Vision

To sit down and tell a chat bot your project idea and have it write it for you while debugging and committing it's work while seamlessly being able to collaborate with it, giving it code reviews, helping each other debug, etc.

Features

  • Auto stores all conversation and message data in SQLite db for latter experimentation & model fine tuning
  • AI-powered programmer using OpenAI's ChatGPT 3 API
  • The AI can run terminal commands after the user confirms their safety
  • The user can play the part of the AI to 'coax' an un-tuned LLM into development rather than conversation

Screenshot of the chatbot UI

Installation

  1. Obtain an API key for OpenAI here
  2. Start a linux system where you want to run this program.
  3. Place the api key in a text file as such:
    mkdir -p ~/.config/ModelProgrammer
    echo "<your_api_key_here>" > ~/.config/ModelProgrammer/API_key.txt
    

    Note this is loaded from the __init__.py file if you wish to change it.

  4. Install ModelProgrammer in your favorite python 3.10 virtual environment
    git clone https://github.com/yourusername/ModelProgrammer.git
    cd ModelProgrammer
    pip install -e ./
    

Usage

  1. cd into ModelProgrammer
  2. Run:
    python3 main.py
    

Ok, it's going

How use thing?

  1. Type messages at the bottom and they will send to the model when the check box next to the send button is ticked. (un tick it to build up a fake conversation without sending)
  2. Change the drop down at the bottom to assistant and the terminal will respond to you when you add the message and then click run (the Run Send and Add button are all the same button)
  3. Uncheck messages to not have them sent to the model (easy context saving)
  4. Edit messages and click checkmark to save them (they'll immediately be in the database)

Whats Next?

First the user interface will gain greater ability to mix and match pieces of previous conversations, review responses, and allow the model to more cleanly and consistently interact with both the terminal and the user at the same time.

This really needs to be constrained to a safe environment. Thinking the AI can only interact inside a docker container!

Then, and during development training data will be collected to improve model interaction with the terminal.

3 key immediate areas of focus are:

  1. Correctly making small edits using eof inserts or patch files or other means
  2. The model tends to prefer to edit the test rather than the code
  3. It doesn't explore it's environment enough (tree, git logs, docs, ls etc) and needs to be able to summarize what it has so far rather than relying totally on context.

As the UI becomes quicker to work with, with less back and forth or work in cleaning up the models mistakes, the UI essentially becomes a data labeling and dataset curating tool for a human supervised boot strapped training method for AI coding.

One unique thing that could be done for instance is any time a change by the AI causes a test to fail, its final version once it gets the test to pass, could be paired with the original request to teach it better programming. You basically just filter out all the code that caused a failed test to make a dataset for fine tuning using code it iterated on for you.

License

This project is licensed under the GNU General Public License v3.0 or any later version - see the LICENSE file for details.

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

ModelProgrammer-0.0.1.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

ModelProgrammer-0.0.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file ModelProgrammer-0.0.1.tar.gz.

File metadata

  • Download URL: ModelProgrammer-0.0.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for ModelProgrammer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8685e8faa8dea52ab63a5dd2f58168188195c261548446964686f24f79123334
MD5 5dd22f56bc776c55d1a7457878315701
BLAKE2b-256 4cd8d057f8c84f1a4b6b8460a1089b61cb267f53836d107616341d1e7c5c7552

See more details on using hashes here.

File details

Details for the file ModelProgrammer-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ModelProgrammer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e56bffc1bd8a536cb6c72a39ee194068f51567c4d6beb8cf695d8cf168a741a
MD5 da4230aa3d040119997b08f3b63f0e81
BLAKE2b-256 0a8d0712b3c3c973fe26ce49a1f171715a895499a5671d69f1132156a9b155d5

See more details on using hashes here.

Supported by

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