la

lambdaprompt – build, compose and call templated LLM prompts

Hacker News

lambdaprompt – build, compose and call templated LLM prompts

For the past few months I've been building a lot of things with LLMs (GPT-3, Codex, etc.) as I've been trying to push them to their limits (especially towards applying them to the tabular data domain) When working on this, I've found there are some common patterns for solving problems (templating, chaining, functional-programming style operations, etc.) As I've iterated, I've come to believe that a functional style interface is likely going to power a new wave of systems I'm calling "prompt-machines"(systems where the core new unit of work is a "named" LLM prompt, extending the "function" concept). Additionally, in order to make the code capable of meta-prompting (where the LLM can write its own templated prompts), I aimed to make the interface and library as simple and lightweight as possible. I think I've achieved my goal, so I'm releasing the library to share with others! I mainly use lambdaprompt in two main ways: (1) to quickly try out "map" applying a LLM prompt against multiple inputs, to see how it behaves on a fixed set of inputs (2) to quickly iterate on a prompt-chain (taking the output of a prompt, and passing it to other prompts) to create complex behavior. An example of (2) that worked quite well is a Text-2-SQL prototype: It generates multiple SQL options, then executes each against the database (if it errors, asks `Codex-EDIT` to fix the errors and retry), then takes the most "consistent" answer as the valid answer. Simply by adding this prompt-chain on top of codex, we saw an improvement from ~75% to ~85% on a spider Text-2-SQL benchmark (On just a small sample of N=200). To increase usability it also ships (extras) with a fastapi app that registers any defined prompts as endpoints directly, and hosts the functions to be directly callable via HTTP-GET requests. This makes it easy to build client-applications off of these prompts, while allowing the prompt itself to be arbitrarily complex (composition of prompts) I hope you enjoy using it! Also, I'm super curious to hear if anyone else has been thinking about LLMs (composing them, building interfaces to them, etc.) in similar ways and what learnings have been (even if not though this library)

Share card

Actual performance

9points
1comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: mac, codex, new · Missing: agents, macos, agent
95%95% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
90%90% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
61%61% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRFits verified-revenue profile · Strong signals: month, way · Missing: mobile apps, ios, personal
52%52% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: host, interface · Missing: plus, platform, intuitive
41%41% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
14%14% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Re
Recursive LLM Prompts53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Recursive LLM Prompts

Hacker News97
Pr
Prompt-Compose.js Use Axioms and Compositions to Build Modular Prompts44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Prompt-Compose.js Use Axioms and Compositions to Build Modular Prompts

Hacker News6
Compose Academy
Compose Academy46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Learn how to build apps with Jetpack Compose

Indie Hackerscommitment-side-project
Co
Compose Auto Numbered Tweetstorms22%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Compose Auto Numbered Tweetstorms

Hacker News2
Pr
Promptmetheus – Compose one-shot prompts for the OpenAI API33%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Promptmetheus – Compose one-shot prompts for the OpenAI API

Hacker News1
Pr
PrePrompt – rewrites vague prompts before they reach the LLM44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

PrePrompt – rewrites vague prompts before they reach the LLM

Hacker News23
Coralflavor
Coralflavor33%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Unfiltered LLM That Doesn't Reject Prompts

Indie Hackerscommitment-side-project
LL
LLM-powered webapp to build LLM-powered webapps68%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

LLM-powered webapp to build LLM-powered webapps

Hacker News2
Se
Serve LLM prompts via CDN (free and no account allowed)56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Serve LLM prompts via CDN (free and no account allowed)

Hacker News1
Co
Components for Jetpack Compose29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Components for Jetpack Compose

Hacker News1