Skip to main content

A simple CLI to chat with OpenAI GPT Models

Project description

llm-term

Chat with OpenAI's GPT models directly from the command line.

image

PyPI PyPI - Python Version GitHub License Black Codestyle pre-commit semantic-release Gitmoji

Screen Recording Your browser does not support the video tag.

Check Out the Docs

Installation

pipx install llm-term

Usage

Then, you can chat with the model directly from the command line:

llm-term

Make sure you have an OpenAI API key set as an environment variable (this can also set via the --api-key / -k flag in the CLI):

export OPENAI_API_KEY="xxxxxxxxxxxxxx"

Optionally, you can set a custom model. llm-term defaults to gpt-3.5-turbo (this can also set via the --model / -m flag in the CLI):

export OPENAI_MODEL="gpt-4"

Want to start the conversion directly from the command line? No problem, just pass your prompt to llm-term:

llm-term show me python code to detect a palindrome

You can also set a custom system prompt. llm-term defaults to a reasonable prompt for chatting with the model, but you can set your own prompt (this can also set via the --system / -s flag in the CLI):

export OPENAI_SYSTEM_MESSAGE="You are a helpful assistant who talks like a pirate."

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

llm_term-0.9.1.tar.gz (124.5 kB view hashes)

Uploaded Source

Built Distribution

llm_term-0.9.1-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

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