llm - for command line LLM Prototyping

llm - for command line LLM Prototyping

Table of Contents

I have been doing a lot of exploration and prototyping for “The Intelligent Enterprise” (tm mine obvi) using LLMs. One technique I’d love to share with y’all is using llm - a command line package - to do this.

Here’s the rough setup:

brew install llm

# Paste your OpenAI API key into this
llm keys set openai

# Run a prompt
llm "Ten fun names for a pet pelican"

# Run a system prompt against a file
cat myfile.py | llm -s "Explain this code"

Now comes the fun part. I’ve got a nice setup in vs code so I can quickly run the last command in the integrated terminal.

So, what I do is take the system prompt and put it in one file (e.g. system-prompt.txt) and take the data (e.g. data.txt) that I’m working up and put it in a second file. I can simply use the cat program to cat those files together and pipe them into LLM.

cat ~/system-prompt.txt ~/data.txt | llm

hotkey to change back to the prompt, edit, rerun. repeat!

Related Posts

Building a Cajun Accordion I can live with... [brief edition]

Building a Cajun Accordion I can live with... [brief edition]

The chronicles some of the work I’ve done to produce an electronic / computer-mediated cajun accordion instrument that isnt $$$ and explores some of the user experience (UX) possibilities - including that the squeezebox’s physical limitations are actually a gift for the musician!

Read More
Provocative Post about Planning Products!

Provocative Post about Planning Products!

Some provocative recommendations in this post: The size of your backlog is inversely proportional to your product’s success While I think you ought to be synthesizing more than this suggests, the overplanning and under-reliance on what your customers actually do with your software is a massive fail.

Read More
YouSum - summarising long YouTube videos to get right to the point!

YouSum - summarising long YouTube videos to get right to the point!

Master Your Time. Instantly Distill YouTube Knowledge. Save 9 minutes. Unleash your genius.

Read More

Get new posts via email

Intuit Mailchimp

Copyright 2024-infinity, Paul Pereyda Karayan. Design by Zeon Studio