AntonAntonov/Chatnik

CLI scripts for conversing with persistent LLM personas

Paclet Manifest

Web ContentResourceCreateNotebook

Headline ImageResourceCreateNotebook

Basic DescriptionResourceCreateNotebook

Command Line Interface (CLI) scripts to manage and interact with multiple, persistent Large Language Model (LLM) chat objects. Access to repository prompts is provided via automatic prompt expansion. Access to chat object elements (history, models, etc.) facilitates the creation of useful CLI pipelines.

DetailsResourceCreateNotebook

The paclet provides Command Line Interface (CLI) scripts for conversing with- and managing persistent Large Language Model (LLM) personas.

The script "LLMChat" is used to interact with the chat objects.

The script "LLMChatMeta" is used to mange the chat objects -- deletion, getting context, first- or last message, clearing of messages, etc.

The script "LLMPrompt" is used to get the texts of repository prompts in the shell environment.

"Chatnik" uses the Wolfram Language persistent values functionalities in order to maintain persistent interaction with multiple LLM chat objects.

"Chatnik" can be seen as a package that "moves" the LLM-chat objects interaction system of the paclet "Chatbook" into typical OS shell interaction. (I.e. an OS shell is used instead of a Wolfram notebook.)

There are several consequences of this approach:
(1) Multiple LLMs and LLM providers can be used,
(2) The chat messages can use the provided by Wolfram Language prompts collection and prompt spec DSL, 
(3) Easy access to OS shell functionalities.

Primary ContextResourceCreateNotebook

AntonAntonov`Chatnik`

Main Guide PageResourceCreateNotebook

ExamplesResourceCreateNotebook

Initialization for ExamplesResourceCreateNotebook

PacletDirectoryLoad[NotebookDirectory[]];

Needs["AntonAntonov`Chatnik`"];

Basic Examples

The script "LLMChat" is used to interact with the chat objects. Create and chat with an LLM persona named "yoda1" (using the Yoda chat persona):

Continue the conversation with "yoda1":

Execute a chat object management command using the script LLMChatMeta -- view the whole interaction with "yoda1":

Clear the messages of "yoda1":

Scope

Installation MacOSX & Linux

Copy paclet's scripts to a directory that is already in shell's PATH variable. For example, "~/.local/bin":

ChatnikCopyScripts["~/.local/bin"]

On MacOSX if no directory is specified for ChatnikCopyScripts (i.e the directory is Automatic) then paclet's scripts are copied in the "~/Applications" directory:

ChatnikCopyScripts[]

Chat pipelines

Longer CLI pipelines make "Chatnik" very useful. For example:

Chat objects management

The script "LLMChatMeta" is used to manage the chat objects. Here is its usage message:

Give a list of all chat object summaries in JSON format:

Source & Additional Information

CreatorResourceCreateNotebook

Anton Antonov

Source Control RepositoryResourceCreateNotebook

https://github.com/antononcube/WL-Chatnik-paclet

LicenseResourceCreateNotebook

KeywordsResourceCreateNotebook

chat objects

large language models

persistence

persistent objects

LLM

LLM chat

CategoriesResourceCreateNotebook

Related Resource ObjectsResourceCreateNotebook

AntonAntonov/OpenAIMode

Wolfram/Chatbook

Wolfram/CommandLineParser

Original Source References and AttributionsResourceCreateNotebook

Chatnik: LLM Host in the Shell — Part 1: First Examples & Design Principles | Raku for Prediction

Chatnik: LLM Host in the Shell — Part 1: First Examples & Design Principles | Python for Prediction

LinksResourceCreateNotebook

Raku Land - Chatnik

Chatnik · PyPI

CompatibilityResourceCreateNotebook

Wolfram Language VersionResourceCreateNotebook

14.3+

Operating SystemResourceCreateNotebook

EnvironmentsResourceCreateNotebook

Cloud SupportResourceCreateNotebook

Required FeaturesResourceCreateNotebook

DisclosuresResourceCreateNotebook

Author NotesResourceCreateNotebook

The WolframScript scripts "LLMChat.wls", "LLMChatMeta.wls", and "LLMPrompt.wls" have to be placed into suitable directories and have execution permissions. (See ChatnikCopyScripts.) Established access to Large Language Model (LLM) provider(s) has to be in place before using the scripts of this paclet.