The Problem

Developers need ready‑to‑run, end‑to‑end demos that show how Liquid AI’s open‑weight models (LFM) can be integrated with the LEAP SDK for tasks such as OCR‑based data extraction, audio transcription, and multimodal agentic workflows. Without concrete examples, teams spend weeks prototyping boilerplate code, handling model download, and wiring platform‑specific utilities.

What This Does

The cookbook repository supplies a curated set of self‑contained examples under examples/. Each demo ships with:

A Python package (e.g., audiotranscriptioncli, invoiceparser, voicechat) whose source lives in src/ and is declared in a local pyproject.toml. Model‑download helpers (modeldownloader.py, modelwrapper.py) that abstract the LEAP SDK calls needed to fetch LFM checkpoints. Configuration files (configs/.yaml) that specify model variants (e.g., lfm2350m.yaml) and inference parameters.

Key entry points:

ExampleCore filePurpose
invoice‑parserexamples/invoice-parser/src/invoiceparser/main.pyCLI that takes an image of a utility bill, runs a two‑step agentic workflow (OCR → structured extraction) and prints JSON.
audio‑transcription‑cliexamples/audio-transcription-cli/src/audiotranscriptioncli/transcribe.pyStreams microphone input through LFM2‑Audio‑1.5B via llama.cpp and prints live captions.
voice‑chatexamples/voice-chat/src/voicechat/server.pySimple FastAPI server exposing a chat endpoint that uses a text‑to‑text LFM2 model for turn‑based conversation.

All examples share the same build pattern: a Makefile that runs uv sync (or uv install) and a thin wrapper script that launches the Python entry point.

How To Use It

1️⃣ Clone the repo

git clone https://github.com/LiquidAI/cookbook.git cd cookbook

2️⃣ Install UV (if not present)

curl -LsSf https://astral.sh/uv/install.sh | sh

3️⃣ Choose an example, e.g. invoice‑parser

cd examples/invoice-parser

4️⃣ Install dependencies (the pyproject.toml defines them)

uv sync # creates a .venv and resolves versions

5️⃣ (Optional) Download the model once – the script does it lazily, but you can pre‑fetch using the helper: python -c "from audiotranscriptioncli.modeldownloader import download; download('lfm2350m')"

6️⃣ Run the demo

python -m invoiceparser.main --image ../invoices/Sample-electric-Bill-2023.jpg

The same steps apply to other demos; replace the directory and entry point (lfm2-english-to-korean/main.py, voicechat/server.py). Configuration files such as examples/browser-control/configs/lfm2350m.yaml can be edited to point at a different checkpoint or adjust temperature, maxnewtokens, etc.

Real‑World Use

A fintech onboarding service could embed the invoice‑parser CLI in its document‑processing pipeline:

import subprocess, json, pathlib

def extractbill(imagepath: pathlib.Path) -> dict: result = subprocess.run( ["python", "-m", "invoiceparser.main", "--image", str(imagepath)], captureoutput=True, text=True, check=True ) return json.loads(result.stdout)

billdata = extractbill(Path("/data/bills/2023-07-01.jpg")) → {'accountnumber': '12345678', 'totaldue': 89.45, ...}

The extracted JSON can be fed directly into downstream AML or accounting systems without writing custom OCR or LLM glue code.

Code Health & Issues

Med – No CI/CD – No .github/workflows or other pipeline files; automated testing and linting are absent. Med – Missing LICENSE – Repository root lacks a license file, leaving redistribution rights unclear. Low – No lockfile for some examples – examples/audio-transcription-cli/pyproject.toml declares dependencies but only a uv.lock is present in the root of that example; other examples rely solely on pyproject.toml, making reproducible builds harder. Low – Sparse test coverage – Only one test file detected across 157 source files; many critical paths (model download, error handling in transcribe.py) are untested. Low – Inconsistent environment docs – README lists many demos but each example’s own README.md is brief; required environment variables (e.g., LEAPAPI_KEY) are mentioned only in code comments, not centrally documented.

No obvious security red flags (e.g., hard‑coded secrets) were found. Code follows a clear package layout, and type hints (py.typed) are present, indicating some attention to static analysis.

The Bottom Line

The cookbook provides a practical, hands‑on collection of ready‑to‑run demos that illustrate how to pair Liquid AI models with the LEAP SDK. It is valuable for teams that need concrete reference implementations for OCR, audio transcription, or chat agents. However, the lack of CI, licensing, and comprehensive tests means the repo is best used as a learning sandbox rather than production‑grade code. Organizations should add their own CI pipeline, lockfile strategy, and licensing before adopting any example in a critical system.