Add your description here
Project description
chit
chit is a git-analogous system for managing LLM chat conversations in a Jupyter notebook. Install as pip install chitgpt.
The chit.Chat class has methods:
commit()for adding new messages (either user or assistant). For creating an assistant message, the message path leading from the root to the current checked-out message is sent to the LLM.branch()for creating a new branch at the current checked-out messagecheckout()for changing the checkout message.push()for dumping pushing to aremote(a json file + an html gui visualization)clone()a classmethod for initializing achit.Chatobject from a json file- sensible indexing and slicing
rm()for removing a branch or commitmv()for renaming a branchfind()for finding in conversation historylog()for creating simple tree or forum style visualizations of the chatgui()for creating a (non-interactive) html gui output of the conversation similar to a classic LLM interface
See example.ipynb for some demonstration, as well as example2.ipynb where we re-clone an earlier chat and play with it, and example3.ipynb for demonstrations with tool-calling.
setting stuff
Change the model by directly modifying the model attribute e.g.
chat.model = "openrouter/anthropic/claude-3.7-sonnet"
We use litellm for the LLM completions, so use their model naming conventions (very useful comprehensive list here).
Vision is supported, including images from the clipboard like so: chat.commit("Analyze this image.", image_path = '^V').
Change tools by modifying the tools attribute (which is a list of functions), then calling recalc_tools(), i.e.
chat.tools.append(web_search)
chat._recalc_tools()
Here web_search should be a Python function with either (1) a json attribute in the OpenAI specification or (2) a numpy-style docstring, which lets us automatically calculate the json attribute using litellm.utils.function_to_dict.
Tool-calling is not compatible with streaming. If your chat has tools, you can pass chat.commit(enable_tools=False) to temporarily disable tools for that AI call and enable streaming.
imports
We have a (probably very rudimentary) importer function for Claude exports, used as follows:
import chit
from chit.import_claude import import_claude
chat = import_claude("claude.json")
Here is how you get a Claude export (for a particular chat) -- do not use the default Claude data dump in account settings (this does not preserve tree structure); instead load the Claude chat with Chrome Dev Tools > Network open and find the correct resource.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chitgpt-1.6.0.tar.gz.
File metadata
- Download URL: chitgpt-1.6.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49b80f0708cc36dfe58e522e6ce46a01afe662a31e3c07ad1f080ca30977f650
|
|
| MD5 |
ab47620ef35355b37217d20a114e89eb
|
|
| BLAKE2b-256 |
0799f8f39cd5114ed3fed2c389ddd4c65e1fd01727971c16d942f98d7dbee42c
|
File details
Details for the file chitgpt-1.6.0-py3-none-any.whl.
File metadata
- Download URL: chitgpt-1.6.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c640f0f4e98f27da836244b028e7b79535eb9060f9ee361dd689abbb5548424d
|
|
| MD5 |
717e30145425f68e2da69b80e31f524d
|
|
| BLAKE2b-256 |
7cd4e98f0e02e9fffd97a3ea95b0f5e9f4a09b38a60b63e8940d3c966eb93afc
|