Welcome to the 29 November 2024 release of Gptcmd! This is a very substantial release that introduces multi-provider and multi-account support, adds the ability to attach images to messages for use with vision models, implements a new configuration system and message editor, and enhances cost estimation, streamed responses, and the general command-line experience.
Important notes
Python 3.7 deprecation
[Python 3.7 reached end-of-life on 27 June 2023](https://devguide.python.org/versions/). While Gptcmd currently maintains best-effort compatibility with Python 3.7, this support is deprecated and will be removed in the next release. Updating to Python 3.8.6 or later is strongly recommended.
JSON file compatibility
JSON files created with older versions of Gptcmd can be loaded with this version, but any files saved with Gptcmd version 2.0.0 or later will be incompatible with previous versions due to changes in the JSON format. Users attempting to load the newer JSON format using a previous release will be instructed to update Gptcmd to version 2.0.0.
New features
* An `image` command has been added, which allows images to be attached to messages by file or URL. Consult the readme for [instructions on using Gptcmd with vision models](https://github.com/codeofdusk/gptcmd#working-with-images).
* Gptcmd can now be used with additional providers besides OpenAI:
* Azure AI.
* OpenAI-compatible APIs, such as [OpenRouter](https://openrouter.ai) and [Ollama](https://github.com/ollama/ollama/blob/main/docs/openai.md).
* [Anthropic Claude](https://github.com/codeofdusk/gptcmd-anthropic).
* [A custom provider of your own design](https://github.com/codeofdusk/gptcmd/tree/master/src/gptcmd/llm).
* Cost estimation has been completely rewritten:
* The new cost estimator supports nearly all OpenAI models.
* Gptcmd now provides cost estimates for streamed responses that complete successfully.
* Incomplete cost estimates (estimates for sessions where not every response has a cost estimate available) can optionally be enabled.
* Gptcmd now takes the discount on [cached prompt tokens](https://platform.openai.com/docs/guides/prompt-caching) into account when calculating estimated OpenAI costs.
* Gptcmd can now display prompt and sampled token usage on streamed responses.
* Gptcmd now has a configuration system for setting application options and specifying credentials for large language model provider accounts. Consult the readme for [more information about the configuration format](https://github.com/codeofdusk/gptcmd/#configuring-gptcmd).
* An `account` command has been added to switch between configured large language model provider accounts.
* The `flip` command has been replaced with a `move` command that allows for arbitrary message reordering.
* The `slice` command has been replaced with a `copy` command that appends copies of a message range to a specified thread.
* Gptcmd now supports the use of an external text editor for some operations:
* With no arguments, the `user`, `assistant`, `system`, and `say` commands now open an external editor for message composition.
* An `edit` command has been added, which opens the selected message in an external editor so its content can be modified.
* Command feedback across the application has been significantly improved.
Changes
* Gptcmd now displays token usage by request, not by session.
* The `n` API parameter, which controls the number of responses generated by OpenAI models, is no longer supported.
* The default `temperature` setting of 0.6 has been removed, so no temperature value is sent with API requests unless explicitly set. This means that the default `temperature` for OpenAI requests is now effectively set to 1.
* Gptcmd now works with API parameters and the selected model on a per-account (not per-thread) basis and no longer saves these parameters to JSON files.
* By default, Gptcmd now streams responses when possible.
* Gptcmd now uses `gpt-4o` by default in OpenAI sessions.
* The `retry` command now deletes from the end up to the last assistant message, not the entire span of messages after the last user message, before resending. In conversations of alternating user and assistant messages, this change has no effect. However, this greatly simplifys the use of `retry` with models that allow the generated assistant response to be constrained with a custom prefix.
Bug fixes
* Gptcmd is now much more stable when streaming responses.
* Gptcmd's command parsing has been improved, including better handling of quoted file paths and more predictable behaviour with message ranges containing a single negative index.
* General improvements to stability and performance have been introduced as part of a larger refactoring effort.