Skip to main content

Chat with LLMs from the terminal

Project description

Terminal LLM Chatbot

A python terminal-based chatbot application that integrates with language models using LangChain. Features include multiline text input and streaming responses.

Features

  • Terminal-based user interface with rich text formatting
  • Support for multiline text input
  • Streaming responses from the language model
  • Markdown rendering for assistant responses
  • You can edit the conversation at any point to add/remove context
  • Configurable via YAML
  • Supports Claude 3.7 (with optional extended thinking), ChatGPT-4o and o3-mini
  • Change models/chats on the fly

Installation

You can install llm_chat_term using uv by running:

uv tool install llm_chat_term

or if you don't have uv installed:

pip install llm_chat_term
# or
pipx install llm_chat_term

Set up your API key(s)

On first run, a config.yaml with default options is created in your Config dir (e.g. ~/.config/llm_chat_term) Edit it to add your API keys and customize other options. Then re-run the application.

Usage

Run the chatbot from the command line:

llm_chat_term

Controls

  • Type your message and press Alt(Esc)+Enter to send
  • Use Enter to add a new line in your message
  • Type /exit, exit, or press Ctrl+D to exit the application
  • Type /help to view help for available commands
  • Press Ctrl+C to interrupt and exit

Configuration

The following environment variables can be set in the config.yaml file:

llm:
  models:
    - provider: anthropic
      model: claude-3-7-sonnet-20250219
      api_key: ""
      temperature:
    - provider: openai
      model: gpt-4o
      api_key: ""
      temperature:
    - provider: openai
      model: o3-mini
      api_key: ""
      temperature:
  system_prompt:
    You are a helpful assistant responding to a user's questions in a PC
    terminal application. The user is an experienced software engineer, your answers
    should be concise and not repetitive. Skip conclusions and summarizations of your
    answers.If the user asks for a change in code, don't return the whole code, just
    the changed segment(s).
ui:
  prompt_symbol: ">>> "
  user: user
  assistant: assistant
colors:
  user: cyan
  assistant: grey39
  system: yellow

License

MIT

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_chat_term-0.1.5.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_chat_term-0.1.5-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file llm_chat_term-0.1.5.tar.gz.

File metadata

  • Download URL: llm_chat_term-0.1.5.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_chat_term-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b82dccb2569160b9ab91c9ad5d4dd3e1e724944f9a15f171358d077ca9cd8d0b
MD5 faf1df4966e4d9ce64d659d28fba60ae
BLAKE2b-256 a7acdfae5169480f5d14d2d157dabfdef4f378fac507abb6de85d1b5df3cec88

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_chat_term-0.1.5.tar.gz:

Publisher: main.yml on vtsiolkas/llm_chat_term

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_chat_term-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: llm_chat_term-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_chat_term-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f19e9b3fade8bfcbc17bf1de51ad5c8c79ede43cfc15c509db3c63915e9c88c8
MD5 bb2fa563455c3f74cd3531a96f322027
BLAKE2b-256 ed88db39535a025acaea5ee802b843fbfdf4305f52fcccdc9276229273e53e35

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_chat_term-0.1.5-py3-none-any.whl:

Publisher: main.yml on vtsiolkas/llm_chat_term

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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