Code Monkey home page Code Monkey logo

cllm's Introduction

Command Line LLM (cllm) Toolkit


Image generated using cllm-clam.sh

Command Line LLM (cllm) Toolkit is a command line tool for interfacing with LLM models. It is designed to be a simple and easy to use tool for generating text from a prompts. It includes a suite of tools for interfacing with cllm output to build more complex prompt chaining processes.

Why?

Most of us were introduced to LLMs through the ChatGPT GUI. The GUI is great for getting started, but it is limiting. You can't easily interface with files and other programs. It's not ideal for more complex workflows. Exactly what it is doing under the hood is magic.

Prompt Chaining Libraries are very powerful and make it possible to build complex workflows, but they can hide a lot of what is happening under the hood around prompt generation, chaining, and function calling.

Notebooks are great for documentation prototyping and sharing, but they are not ideal for building complex workflows and deploying your projects.

Agent frameworks are great for getting complex agent workflows up and running quickly, but they hide a lot of what is happening under the hood. Their configuration can be complex and very opinionated.

The cllm toolkit attempts to solve these issues by being bash centric. Allowing you to chain LLM inference process with all the bash commands you are familiar using bash pipeing. Also giving you a suite of tools such as Vector Stores, Text Splitters, Data Loaders, and Ouput Parsers for building more complex prompt chaining flows all using bash scripting.

Requirements

  • Python 3.8+
  • Poetry
  • OpenAI API Key set as OPENAI_API_KEY environment variable

Recommended

  • jq
  • Ollama

Note

So far this has only been verified on MacOS. It should work on Linux. It may work on Windows, but I have not tested it.

Getting Started

git clone [email protected]:o3-cloud/cllm.git

cd cllm

poetry install
poetry shell

cllm

Installing cllm Globally

To install the command to your default python environment, run a poetry build, then install the project's wheel.

rm -rf dist

poetry build
pip install dist/*.whl

cllm --help

Copy the .cllm directory to your home directory.

cp -r .cllm ~/.cllm

Then initialize the CLLM_DIR environment variable in your .bashrc or .zshrc.

bash

echo "export CLLM_DIR=\$HOME/.cllm" >> ~/.bashrc

zsh

echo "export CLLM_DIR=\$HOME/.cllm" >> ~/.zshrc

Running Via Docker

docker build -t cllm .
docker run -e OPENAI_API_KEY=$OPENAI_API_KEY --rm cllm gpt/3.5 "What is the meaning of life?"

Accepting stdin

cat README.md | docker run -e OPENAI_API_KEY=$OPENAI_API_KEY -i --rm cllm -t qa gpt/4o "How do I use cllm with docker and stdin?"

CLLM Command

Here is an example of how you might use the cllm toolkit to generate text from a prompt.

cllm gpt/3.5 "What is the meaning of life?"

To learn more about the cllm command see the cllm documentation.

For more examples see the examples directory.

Toolkit

In addition to the cllm command, the cllm toolkit includes a suite of tools for interfacing with cllm output to build more complex prompt chaining processes.

To learn more about the toolkit see the toolkit documentation.

See the toolkit directory for more information on how to use the toolkit commands.

cllm's People

Contributors

agento3 avatar austintschaffer avatar everowen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.