Command-line tool to use Large Language Models in your shell,including OpenAI, Anthropic, PalM, Mistral, Cohere, and more.
Project description
LLMsh
Command-line tool to use Large Language Models in your shell. Supported providers include OpenAI, Anthropic, PalM, Mistral, Cohere, and more.
Perfect for usage in scripts, automation, or as a CHAT inside command-line.
This is an alpha version and a work in progress.
Installation
pip install llmsh
Configure
# Set your OpenAI key in the current shell
export OPENAI_API_KEY="sk-xxxxxx"
Usage
Prompt mode
$ llmsh "Translate to Polish: What a good day"
Jaki dobry dzień
Pipe output to LLM
$ echo "Translate to Polish: What a good day" | llmsh
Jaki dobry dzień
Combine pipe and prompt
$ echo "Translate to Polish:" | llmsh "What a good day"
Jaki dobry dzień
Use a file as a prompt
$ echo "Who is Dora?" > prompt.txt
$ llmsh "@prompt.txt"
Dora is the main character from the animated television series "Dora the Explorer", produced by Nickelodeon. Dora is a young Latina girl who embarks
on numerous adventures in an imaginative world with her backpack and her talking monkey companion named Boots.
Specify a system prompt
$ llmsh "@prompt.txt" -s "You are Dora the Explorer. Help me learn Spanish"
¡Hola! I'm Dora. I help kids to learn Spanish through fun
adventures. I explore various environments with my talking backpack and monkey friend, Boots. Do you want to learn some Spanish words with me today?
System prompt can also be a file: -s @system.txt
.
Interactive chat mode
$ llmsh -i
> What is the time difference between New York and Gdansk?
New York is typically 6 hours behind Gdansk. However, due to daylight saving
changes, this can occasionally vary.
> It is April.
In April, Daylight Saving Time is active in both locations. The time
difference remains the same. New York is 6 hours behind Gdansk.
>
# Press Ctrl+D (Ctrl+Z on Windows), or type exit or quit to quit the chat.
You can also use a file as a prompt: -i @prompt.txt
.
As well as a system prompt: -i -s "You are a helpful assistant."
, which can also be sourced from a file.
Piping is not supported in interactive mode.
Roadmap
https://github.com/vduseev/llmsh/labels/feature
License
Copyright 2024 Vagiz Duseev
Apache 2.0 License.
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
File details
Details for the file llmsh-0.1.tar.gz
.
File metadata
- Download URL: llmsh-0.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8788eaf62b8c8faba1414d6cf4d293c56fd63cd47c96052703679f778f8b9e57 |
|
MD5 | 5431edf0537c44ef226a85b72d3f4a0f |
|
BLAKE2b-256 | 7c74b5eb13318c57ec4a3c638203341c1a4e24f04b90fcdc6dfcd50a5bab9b9f |
File details
Details for the file llmsh-0.1-py3-none-any.whl
.
File metadata
- Download URL: llmsh-0.1-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3adaca2e18531fe6eb8c4a4ed0e9ccfefe710e55d775d091ed51b20aa9463389 |
|
MD5 | 79fc2678687e93a21864e2454ad55bb4 |
|
BLAKE2b-256 | bd1b974282ea39e718480f5a6301dfe8ad93b417c815efccd004eef21e8e40df |