Liquid AI Cookbook

repository·main·Indexed 24 days ago

https://github.com/liquid4all/cookbook

A collection of implementation examples, fine-tuning recipes, and deployment guides for Liquid Foundation Models (LFMs). Includes demos for audio car cockpits using LFM2.5-Audio-1.5B and LFM2-1.2B-Tool, real-time audio transcription, WebGPU-based audio interfaces, browser control fine-tuning for LFM2-350M using GRPO and OpenEnv, and car maker identification using LFM2-VL.

Tokens
130.5K
Snippets
220
Records
505
Agent score
84%

What's inside liquid4all-cookbook

  1. Overview of LocalCowork

    main

    LocalCowork is a locally-run AI desktop agent designed for privacy-conscious professionals and enterprise teams. It provides a Claude Cowork-style experience without relying on cloud services or API keys. The application is built to run entirely on the user's local machine, ensuring that all data—including files, transcripts, and meeting notes—stays on the device.

    Key features include:

    • 100% Local & Private: No data leaves the machine, making it suitable for regulated industries like legal, healthcare, and finance.
    • No-Code Tool Use: Instead of writing code, the agent orchestrates tasks by calling structured tools via the Model Context Protocol (MCP).
    • Model-Swappable Architecture: The underlying LLM can be swapped (e.g., from Qwen2.5-32B to LFM2.5-24B) without changing the application layer.
    • Cross-Platform: Native support for macOS and Windows via Tauri.
  2. Overview of Liquid AI Cookbook

    main
    The Liquid AI Cookbook is a collection of examples, tutorials, and applications designed to help developers build with open-weight LFMs (Liquid Foundation Models) and the LEAP SDK. The project provides implementations for various platforms including Desktop (Python/CLI), Browser (WebGPU/WASM), and Mobile (Android/iOS) using the LEAP Edge SDK.
  3. Overview of the Meeting Intelligence Agent

    main

    The Meeting Intelligence Agent is a privacy-preserving AI assistant designed to process meeting transcripts locally. It automates post-meeting workflows by identifying action items, looking up team members in a local directory, creating task records in JSON, drafting follow-up emails, and generating structured markdown summaries.

    It is built to run on consumer hardware (e.g., 32 GB RAM) using the LFM2-24B-A2B model, which supports native function calling and high-speed CPU inference (approx. 112 tok/s).

  4. Review LFM Home Assistant benchmark results

    main

    The benchmark evaluates model performance for Home Assistant tasks using 100 tasks (1 run per task) via either a local llama-server (llama.cpp) or the OpenAI API.

    Results are categorized by:

    • Summary: Overall score and accuracy.
    • Capability: Performance on specific device types (e.g., doors, lights, thermostat) and logic types (multi_tool, rejection, scene, status).
    • Inference Depth: How well the model handles literal, semantic, or boundary reasoning.
    • Phrasing: Performance across different command styles (imperative, colloquial, implicit, question).
  5. Build a Meeting Intelligence Agent

    main

    The Meeting Intelligence Agent is a project designed to process meeting transcripts locally to extract action items, assign owners from a team directory, create task records in JSON, draft follow-up emails, and save markdown summaries. It is built to run on consumer hardware using the LFM2-24B-A2B model, which supports native function-calling and high-speed CPU inference (approx. 112 tok/s).

    Core Workflow

    1. Input: A meeting transcript.
    2. Extraction: Identifies action items.
    3. Lookup: Matches owners to emails using a local team_directory.json.
    4. Execution:
      • Writes tasks to tasks.json.
      • Appends drafted emails to a log file.
      • Saves a structured .md summary to the summaries/ directory.

    All operations are performed locally to ensure privacy.

  6. Explore LocalCowork documentation and resources

    main

    The LocalCowork project provides several key documentation resources for understanding product requirements, tool definitions, model performance, and implementation patterns:

    • Product Requirements: See docs/PRD.md for the full product specification.
    • Tool Registry: docs/mcp-tool-registry.yaml contains machine-readable definitions for all 75 available tools.
    • Model Analysis: The docs/model-analysis/ directory contains a benchmark study covering 8 models and 67 tools, including a failure taxonomy.
    • Demo Workflows: docs/demo/lfm2-24b-demo.md provides specific workflows including exact prompts and expected tool calls.
    • Architecture Decisions: docs/architecture-decisions/ contains ADRs for the orchestrator, pre-filter, sampling, and other components.
    • Implementation Patterns: docs/patterns/ covers patterns for MCP servers, Human-in-the-Loop (HITL), and error handling.
  7. Compare LFM2-24B-A2B Tool-Calling Performance

    main

    LFM2-24B-A2B is a sparse MoE hybrid model designed for low-latency tool calling on consumer hardware. In benchmarks against dense and MoE models:

    • Accuracy: LFM2 achieves ~80% accuracy in single-step tool selection, which is competitive with much larger dense models like Mistral-Small-24B (85%) and Gemma 3 27B (91%), despite having significantly fewer active parameters (~2B active vs 24B-27B).
    • Latency: LFM2 provides sub-second latency (~385ms), making it suitable for interactive, human-in-the-loop applications. In comparison, dense models like Gemma 3 27B can take over 24 seconds per response.
    • Multi-Step Performance: While dense models like Mistral-Small-24B show higher chain completion (66%) due to better reasoning coherence, LFM2's latency makes it more viable for real-time desktop assistants where responsiveness is critical.
  8. Build a wildfire prevention system with LFM2.5-VL-450M

    main

    This project demonstrates how to build a wildfire prevention system using Sentinel-2 satellite imagery and the LFM2.5-VL-450M Vision-Language Model.

    By running the compact 450M parameter model directly on a simulated satellite, the system performs on-orbit inference and only downlinks a lightweight JSON risk profile instead of high-bandwidth raw images. This approach solves the data transmission bottleneck inherent in satellite communications.

    The system uses two types of Sentinel-2 imagery:

    • RGB (B4-B3-B2): Natural color for terrain, urban texture, and water bodies.
    • SWIR (B12-B8-B4): Shortwave infrared to identify vegetation moisture stress and dryness (the primary fuel indicator).
  9. Understand the Voice Assistant fine-tuning project

    main

    This project is an end-to-end tutorial for fine-tuning the LiquidAI/LFM2.5-Audio-1.5B model. The goal is to map spoken Home Assistant voice commands directly to a specific pipe-delimited function call format. The resulting model can then be deployed on-device using llama.cpp.

    Key components include:

    • Fine-tuning: Training the model to recognize 41 specific Home Assistant Function signatures.
    • Deployment: Using a language-model GGUF and an Mmproj GGUF (multimodal projector) for inference via llama.cpp.
  10. Design requirements for a Local Coding Assistant MVP

    main

    The local-coding-assistant project is designed as a 'Hello, World!' tutorial for software engineers to learn agentic coding. The goal is to create a functional, modular, and simple implementation of a coding agent inspired by Claude Code and opencode.

    Key design principles include:

    • Simplicity: Avoid overcomplication; the focus is on educational clarity rather than high polish.
    • Modularity: The system must be split into distinct modules for tools, context management (e.g., compaction, truncation), and the language model.
    • Model Independence: The agentic loop must be decoupled from the specific LLM provider. You should be able to switch between high-capability models (like Anthropic Sonnet) for validation and local models (like LFM2-24B-A2B Q4_0 via llama.cpp) via configuration changes alone.
    • CLI Interface: The user interacts with the tool via a command-line interface with a terminal UI experience similar to Claude Code.
  11. Fine-tune LFM2.5-Encoder for document classification

    main

    This project provides a reusable pipeline for multi-label document classification using LiquidAI/LFM2.5-Encoder-230M or LiquidAI/LFM2.5-Encoder-350M. The pipeline involves fine-tuning a bidirectional encoder, applying mean pooling, and training a linear classification head.

    The workflow uses two primary scripts:

    • train.py: Handles fine-tuning, validation, threshold tuning, and optional test evaluation.
    • predict.py: Classifies individual documents using a saved model.

    The model returns label scores in a single forward pass without text generation.

    train.py    Fine-tune, validate, tune thresholds, and optionally evaluate test
    predict.py  Classify one document with the saved model