{"id":23190637,"url":"https://github.com/mlang/gpti","last_synced_at":"2025-04-05T06:42:17.028Z","repository":{"id":161142816,"uuid":"630883049","full_name":"mlang/gpti","owner":"mlang","description":"A simple REPL for interacting with OpenAI's GPT models","archived":false,"fork":false,"pushed_at":"2023-11-07T07:26:38.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T14:27:29.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-21T11:25:43.000Z","updated_at":"2024-06-23T14:36:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"73b5ce4d-c382-4c5d-8924-c99c1d4c0db9","html_url":"https://github.com/mlang/gpti","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fgpti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fgpti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fgpti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fgpti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlang","download_url":"https://codeload.github.com/mlang/gpti/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299791,"owners_count":20916186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-18T12:15:08.204Z","updated_at":"2025-04-05T06:42:17.005Z","avatar_url":"https://github.com/mlang.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPTi\n\nGPTi is a simple OpenAI API client that makes use of GPT and transcription models.\nIt provides a REPL (Read-Eval-Print Loop) interface for typing questions and receiving answers from the GPT model.\nGPTi also supports speech input and output, allowing you to speak your questions and hear the synthesized answers, very much like the original StarTrek computer.\n\n## Features\n\n- Type questions and receive answers from OpenAI's GPT models.\n- Ask questions with your voice and receive answers as synthesized speech.\n- Use commands to quote files, request spoken output, and start recording from your microphone.\n- Predefined local functions that the GPT model can call.\n\n## Installation\n\nIf you are not particularily experienced with building Haskell programs,\nthe easiest way to install GPTi is to use Haskell Stack.\nYou might be able to install `stack` with your distributions package manager.\nAlternatively, you can use the following command:\n\n```bash\nwget -qO- https://get.haskellstack.org/ | sh\n```\n\nTo install GPTi, follow these steps:\n\n1. Clone the GPTi repository from GitHub:\n\n   ```bash\n   git clone https://github.com/mlang/gpti\n   cd gpti\n   ```\n\n2. Build and install GPTi using Stack:\n\n   ```bash\n   stack install\n   ```\n\n## Configuration\n\n### API Key\n\nTo use GPTi, you will need an OpenAI API key.\nThere are two ways to configure the API key:\n\n1. If you are using the `pass` utility to store your passwords encrypted, insert your API key and set the `OPENAI_API_KEY_PASS_NAME` environment variable to the name. GPTi will invoke the `pass show` command to retrieve the key during startup.\n\n   ```bash\n   export OPENAI_API_KEY_PASS_NAME=OpenAI/API_Key\n   pass insert \"$OPENAI_API_KEY_PASS_NAME\"\n   ```\n\n   You will probably want to set `OPENAI_API_KEY_PASS_NAME` in your `~/.profile`.\n\n2. Alternatively, set the `OPENAI_API_KEY` environment variable to your API key.\n   This is less secure as it will make your API key available to all external programs you run in your shell session.\n\n### User Settings\n\nGPTi can be customized via a YAML configuration file.\nAn example configuration file can be found in [examples/config.yaml](https://github.com/mlang/gpti/blob/master/examples/config.yaml).\nBy default, GPTi expects the config file to be located at `$XDG_CONFIG_HOME/gpti/config.yaml` which typically expands to `$HOME/.config/gpti/config.yaml`.\n\n#### recorder\n\nThis setting allows you to customize the arguments passed to the program used to record speech input.\nCurrently, only `ffmpeg` is supported.\nGPTi will append the necessary arguments to encode the audio and save it to a temporary file.\nAll you need to provide is the part which specifies where to record from.\n\n#### speaker\n\nSimilar to `recorder`, this setting allows to customize the arguments passed to the speech synthesizer.\nCurrently, only `espeak-ng` is supported.\n\n#### chat\n\nHere you can configure the default chat session parameters, like `temperature` or the `model`.  The `messages` key can be used to provide a default set of messages which should always be started from.\n\n```yaml\n  messages:\n  - role: system\n    content: |\n      You are assisting a person capable of installing a Haskell Stack project.\n\n      Please be succinct and remember to use Markdown markup whenever possible.\n```\n\n#### chat_functions\n\nGPTi provides the following predefined functions that can be called by the GPT model:\n\n* `localTime`: Get the current local time of the user's machine.\n* `metar`: Retrieve METAR weather information for an airport with an ICAO code.\n  The model typically already knows ICAO codes for popular airports, so you can ask for the weather in a particular city.\n* `haskell`: Evaluate pure Haskell expressions (no IO) provided by the model.\n  This allows the model to give more accurate answers when numbers are involved.\n\nThis is only an initial set of possible functions.\nNew functions are easy to write (see [GPTi.Functions](https://github.com/mlang/gpti/blob/master/GPTi/Functions.hs)) and interesting PRs are encouraged.\n\n#### transcription\n\nHere you can provide default parameters for the audio transcription.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlang%2Fgpti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlang%2Fgpti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlang%2Fgpti/lists"}