Skip to content

rdsq/clai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clai

A custom CLIent (get it? CLI and client how funny) for different AI things. Primarily chatting, but also some embedding functionality

Privacy friendly: this piece of bytes does not write any data to the drive unless explicitly told to

Interfaces

The format this thing uses for naming models is interfaces. It is provider:model. Available providers:

  • ollama (optional OLLAMA_HOST variable (http://localhost:11434 by default) just like the official Ollama client)

  • google (set the GEMINI_API_KEY env var with the API key)

Installation

Since it is a Rust project, it is pretty straightforward

cargo install --git https://github.com/rdsq/clai

Text generation

This is the main functionality of this project, though not the only one

Generate

Simplest one of them, simply generate a response from a prompt. So it's something like

clai gen ollama:gemma3:1b "Hello World"

You can also attach an image with --image path/to/image.jpg if the model supports it

Chat

This is exactly what you would expect. Open a chat with a chatbot

clai chat ollama:gpt-oss

Chat mode also has commands! Type /help in chat to see more

Read (and saves in general)

It also has a feature where you can define an autosave file in gen and chat using the --file option

To read these JSON files, you can use this command

clai read ./chat.json

Model torturing

These are rather for fun, obviously

Model With Model

Make two AIs talk to one another, forever

You can define them to be the same model, different ones, whatever sounds fun

clai model-with-model "Hello World" ollama:mistral google:gemini-2.0-flash

Monologue

Make a model talk forever. With no inputs, just talk into the void, and see how it goes (probably weird)

clai monologue ollama:phi4

Embeddings

These are not about chatbots, they're about embeddings

Basically a thing that evaluates the semantic meaning of strings

Semantic Search

So basically, you can do stuff like

clai semsearch ollama:nomic-embed-text \
    'fruit' \
    'apple' 'strawberry' 'banana'

Or with files

clai semsearch ollama:nomic-embed-text 'nice weather' --input-format file my-posts/*

Or with JSON (which is for the next feature)

Embed

This one is useful as caching embeddings for the semsearch command. So:

clai embed ollama:nomic-embed-text 'The weather is nice today' 'Cats are awesome' 'Rust is cool' 'hello world' --output-format json > my-posts.json

And then:

cat my-posts.json | clai semsearch ollama:nomic-embed-text -f json 'programming'

Releases

No releases published

Packages

No packages published

Languages