Litmus – Specification testing for structured LLM outputs
Litmus – Specification testing for structured LLM outputs
Over the holidays, I've been working on a small side-project that includes some LLM prompting from the end user. Admittedly, I struggle to keep track of the latest and greatest models, and I've also never bothered to read up on "prompt engineering," so I built a little testing utility to solve both of these problems at the same time. Enter Litmus. I'm pitching it as "specification testing" for LLMs. You define test cases (input prompt -> output JSON), as well as your system prompt and structured output (JSON Schema). All of this gets chucked at OpenRouter, and you get some nice terminal output summarising the test results (with a breakdown per-field for any failing cases) to see how well the model performed. Although it's framed as an LLM testing tool, it also serves as a model comparator. You can pass the `--model` CLI argument multiple times, and this will let you run the test cases against multiple models, with a comparison table generated in the output at the end for evaluating latency, throughput, tokens, and accuracy (tests passing vs. failing). The GitHub README contains a full example output of what a test report from Litmus looks like. With this, I've managed to get my system prompt for my side-project whittled down to the point where the accuracy is acceptable and it's not an exorbitant amount of tokens. I've also found out, through model comparison, that I didn't need anywhere near as large of a model as I had originally envisioned. You can grab it on GitHub as a single-file, zero-dependency executable (written in Go). Admittedly, I've not tested the pre-built binaries that are created via GitHub Actions, but there's no reason why they shouldn't work.
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Pg_yregress, Structured Testing for Postgres
AfricanaWiki – the structured Africana knowledgebase
typed_params – structured and typed parameters for Rails controllers
Xytext – Turn LLM Prompts into Structured API Endpoints
The Unified Playground for LLM Testing
Language-Agnostic Mutation Testing with LLM-Powered Agents
Fuzzpy, a fuzzer for testing CPython
ChefSpec – RSpec testing for Chef Cookbooks
A/B testing baked into RequireJS
A/B testing in Golang with PlanOut