Skip to main content

Charla: Chat with Language Models in a Terminal

PyPI - Version PyPI - Python Version

Charla is a terminal based application for chatting with language models. Charla integrates with Ollama for exchanging messages with model services.

preview

Features

  • Terminal-based chat system that supports context aware conversations with language models.
  • Support for local and cloud models via Ollama.
  • Chat messages are automatically saved during and at the end of chat sessions.
  • Saved chat sessions can be continued.
  • Prompt history is saved and previously entered prompts are auto-suggested.
  • Switch between single-line and multi-line input modes without interrupting the chat session.
  • Store user preferences in user config or current directory settings files.
  • Provide a system prompt for a chat session.
  • Load content from local files and web pages to append to prompts.
  • Markdown in assistant responses and system prompts is rendered in the terminal.

Installation

To use Charla with models on your computer, you need a running installation of the Ollama server and at least one supported language model must be installed.

Install Charla using pipx:

pipx install charla

Usage

After successful installation and setup you can launch the chat console with the charla command in your terminal.

If you use Charla with Ollama, the default provider, you only need to specify the model to use, e.g.:

charla -m gpt-oss

To use Ollama cloud models, you need to run them once with the ollama command and then you can use them, e.g.:

ollama run gpt-oss:cloud
charla -m gpt-oss:cloud

You can set a default model in your user settings file.

Settings

Settings can be specified as command line arguments and in the settings files. Command line arguments have the highest priority. The location of your user config settings file depends on your operating system. Use the following command to show the location:

charla settings --location

You can also store settings in the current working directory in a file named .charla.json. The settings in this local override the user config settings.

To save the current settings to a .charla.json file in the current directory, use the --save argument:

charla settings --save

Example settings for using OpenAI's GPT OSS model by default.

{
    "model": "gpt-oss:20b-cloud",
    "chats_path": "./chats",
    "prompt_history": "./prompt-history.txt",
    "provider": "ollama",
    "message_limit": 20,
    "multiline": false
}

CLI Help

Output of charla -h with information on all available command line options.

usage: charla [-h] [--model MODEL] [--chats-path CHATS_PATH] [--continue-chat CONTINUE_CHAT]
                             [--prompt-history PROMPT_HISTORY] [--provider PROVIDER] [--message-limit MESSAGE_LIMIT]
                             [--multiline] [--system-prompt SYSTEM_PROMPT] [--think {true,false,low,medium,high}] [--version]
                             {convert,settings} ...

Chat with language models.

positional arguments:
  {convert,settings}    Sub Commands
    convert             Convert chat file to markdown.
    settings            Show current settings.

options:
  -h, --help            show this help message and exit
  --model MODEL, -m MODEL
                        Name of language model to chat with.
  --chats-path CHATS_PATH
                        Directory to store chats.
  --continue-chat CONTINUE_CHAT, -c CONTINUE_CHAT
                        File that contains chat to continue.
  --prompt-history PROMPT_HISTORY
                        File to store prompt history.
  --provider PROVIDER   Name of the provider to use.
  --message-limit MESSAGE_LIMIT
                        Maximum number of messages to use for context.
  --multiline           Use multiline mode.
  --system-prompt SYSTEM_PROMPT, -sp SYSTEM_PROMPT
                        File that contains system prompt to use.
  --think {true,false,low,medium,high}
                        Enable thinking for Ollama models that support it.
  --version             show program's version number and exit

Development

Run the command-line interface directly from the project source without installing the package:

python -m charla.cli

License

Charla is distributed under the terms of the MIT license.

Metadata

Release files for charla 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for charla 3.1.0
File Size Uploaded
charla-3.1.0.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for charla 3.1.0
File Interpreter ABI Platform
charla-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.5 kB

Release files / charla-3.1.0.tar.gz

Download URL charla-3.1.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5cc44a15aa43b280703b1965f1d11d9e6501b5b15f075c74b9e9819c5a2a7f17
BLAKE2b-256 checksum
How to use checksums
cee961ade40720c7c01a52742c3800d42e097d33d9d951c54d26fec3261232c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.12.3"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.12.3","system":{"name":"Linux","release":"6.8.0-146-generic"}} HTTPX2/2.3.0

Release files / charla-3.1.0-py3-none-any.whl

Download URL charla-3.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a91e07eb051ec9a8e1c5323f30c51230b5e617b6603faf71aabdeadff5bdf29
BLAKE2b-256 checksum
How to use checksums
9b85f9e6516a83b03947fa52f70de06a9ed6e46186426c1eeb4bd67b76631732
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.12.3"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.12.3","system":{"name":"Linux","release":"6.8.0-146-generic"}} HTTPX2/2.3.0

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.0

2 release files

2.3.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page