Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

plaitime

This is a really simple & lean program to chat with a local LLM powered by the excellent ollama library. It has a rewind feature that allows you to explore alternative paths.

PRs with improvements (optical, technical, ...) are very welcome.

I made this to experiment with different models and prompts, use cases includes:

  • Chat with a generic AI assistant just like in ChatGPT
  • Let LLM impersonate characters to chat with
  • Set up the LLM for pen-and-paper roleplay

Installation

pip install plaitime

You need to pull the models with ollama, for example:

ollama pull llama3.2

See the excellent ollama online documentation what models are available.

Usage

You can create "characters" that use different models and prompts. Each character has their own message history, which is persisted unless you turn that off. Use the combo-box to switch characters.

Chatting

Pressing Enter sends the text to the LLM. When you do that the first time, the LLM may need some time to ramp up, be patient. In the following it will react faster.

You can interrupt the generation or rewind the chat by pressing Escape. This gives you the opportunity to change your previous message, ie. to prevent the LLM from moving into an undesired direction. Another way to correct the LLM is to change the system prompt of the model. The model will always see the current system prompt for its next generation, so you can change its factual memory or personality in the middle of the conversation.

Changing model or system prompt

To create a new character, use the "New character" button. To change the model or system prompt of an existing character, use the "Configure" button. The system prompt is special, because it guides the overall behavior of the LLM. Use it to make the LLM adhere to a given response format, to configure its personality, to provide permanent facts. In short, the system prompt can be regarded as static memory for the LLM.

The LLM will never forget its system prompt, because the program is aware of the size of the context window for each model and will clip the conversation so that it fits into the context window without losing the system prompt. This is important because otherwise your model will forget how to behave.

For some LLMs you can set the temperature, which makes the model more creative, while a low temperature makes it more predictable.

Limitations and workarounds

Because of the finite message window, the LLM will eventually forget details of what you were talking about earlier and become inconsistent. A workaround is to let the LLM periodically make a story summary, which you usually need to edit to fill in details that the LLM missed. You can do that with the "summary" button (which may take a while to complete).

Contributing

See the issues on Github and feel free to contribute!

Note, however, that I want to keep plaitime simple and hackable.

Metadata

Release files for plaitime 0.1.0rc1

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

Source distribution (sdist)

Source distribution for plaitime 0.1.0rc1
File Size Uploaded
plaitime-0.1.0rc1.tar.gz 14.1 kB Details

Built distribution (wheel)

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

Total release size: 28.0 kB

Release files / plaitime-0.1.0rc1.tar.gz

Download URL plaitime-0.1.0rc1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
56f7705a8ef26be9ffc55efb4a659500b5184b0f01337d80e97d42c31fdb451e
BLAKE2b-256 checksum
How to use checksums
b6a619907381db831899da1cf74235b16d383c129fb1f3fa0145c654dee00cd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2024.

Transparency log

Release files / plaitime-0.1.0rc1-py3-none-any.whl

Download URL plaitime-0.1.0rc1-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4572a0e8745455f820ad9b6b508444e39ff2543626b473008c2d45c030512a5f
BLAKE2b-256 checksum
How to use checksums
f47b9ddb23215b3c430be9880293011b800b520c289e8092674f304a8bcb5150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0rc1 This release

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