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.2.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ModelProgrammer-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d65f15cfe44f2b1be7180d666337c4057f59eb422eb8469eab248b0c0db9b461
MD5 4d2acd7abe2d32c66c978b86bb7a2b2b
BLAKE2b-256 594de8fa477f3378cbc781fcbaa9a4a8fa46b5fe493baea1d904422563ab5904

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ModelProgrammer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52a82101ba83d875bb69ee4a67616c2afab099eead9f14000fe9a18383305da0
MD5 f40883369abd108116d2d171b6d54fef
BLAKE2b-256 f562d8ee499cbd51c78ca6e5d5430014d7c720730dbee56f702b5ed063974f53

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