| examples | ||
| .gitignore | ||
| README.md | ||
Liquid AI Cookbook
Build with Liquid AI Models and the Liquid Edge AI Platform
🌊 Liquid Docs | 🤗 Hugging Face | 🚀 Liquid Edge AI Platform
Welcome dear developer! 👋
This repository contains examples, tutorials, and applications built with Liquid AI open-weight models and the open-source LEAP SDK.
Whether you're looking to customize models, deploy to laptops, edge devices, or build complete applications, you'll find resources here to get started.
What are you looking for? 🔍
- Local agentic workflow examples 🤖
- Fine tune an LFM2 model 🎯
- Deploy an LFM2 model to an iOS or Android device 📱
- End-to-end tutorials 📚. Complete walkthroughs from setup to production.
- Examples built by our community 🌟 that you can run and modify
Local agentic workflow examples
| Name | What's that? | |
|---|---|---|
| invoice-parser | A Python CLI that extracts structured data from bill pictures using a 2-step agentic workflow | ▶️ Go to the code |
| audio-transcription-cli | A Python CLI for real-time audio-to-text transcription using LFM2-Audio-1.5B with llama.cpp | ▶️ Go to the code |
Fine-Tune an LFM2 model
LFM2 (Text-to-text)
LFM2 is a generation of hybrid models, designed for on-device deployment, ranging from 350M up to 8B parameters.
These models are particularly suited for agentic tasks, data extraction, RAG, creative writing, and multi-turn conversations. We do not recommend using them for tasks that are knowledge-intensive or require programming skills.
| Model | Technique | |
|---|---|---|
| LFM2-8B-A1B | Supervised Fine Tuning (TRL) | |
| Direct Preference Optimization (TRL) | ||
| LFM2-2.6B | Supervised Fine Tuning (TRL) | |
| Supervised Fine Tuning (Axolotl) | ||
| Supervised Fine Tuning (Unsloth) | ||
| Direct Preference Optimization (TRL) | ||
| LFM2-1.2B | Supervised Fine Tuning (TRL) | |
| Supervised Fine Tuning (Axolotl) | ||
| Supervised Fine Tuning (Unsloth) | ||
| Direct Preference Optimization (TRL) | ||
| LFM2-700M | Supervised Fine Tuning (TRL) | |
| Supervised Fine Tuning (Axolotl) | ||
| Supervised Fine Tuning (Unsloth) | ||
| Direct Preference Optimization (TRL) | ||
| LFM2-350M | Supervised Fine Tuning (TRL) | |
| Supervised Fine Tuning (Axolotl) | ||
| Supervised Fine Tuning (Unsloth) | ||
| Direct Preference Optimization (TRL) |
Need a model for data extraction, RAG, tool use, or math reasoning? Start with our Nano checkpoints—they're already specialized for these tasks.
| Model | Use Cases |
|---|---|
| • LFM2-1.2B-Extract • LFM2-350M-Extract |
• Extracting invoice details from emails into structured JSON • Converting regulatory filings into XML for compliance systems • Transforming customer support tickets into YAML for analytics pipelines • Populating knowledge graphs with entities and attributes from unstructured reports |
| LFM2-1.2B-RAG | • Chatbot to ask questions about the documentation of a particular product. • Custom support with an internal knowledge base to provide grounded answers. • Academic research assistant with multi-turn conversations about research papers and course materials. |
| LFM2-1.2B-Tool | • Mobile and edge devices requiring instant API calls, database queries, or system integrations without cloud dependency. • Real-time assistants in cars, IoT devices, or customer support, where response latency is critical. • Resource-constrained environments like embedded systems or battery-powered devices needing efficient tool execution. |
| LFM2‑350M‑Math | • Mathematical problem solving. • Reasoning tasks. |
Note
The supported languages for these models are: English, Arabic, Chinese, French, German, Japanese, Korean, Portuguese, and Spanish.
Need support for another language?
Join the Liquid AI Discord Community and request it! Our community is working on expanding language support, and your input helps us prioritize which languages to tackle next. Connect with fellow developers, share your use cases, and collaborate on multilingual AI solutions.
LFM2-VL (Text+Image to Text)
LFM2-VL is our first series of vision-language models, designed for on-device deployment.
| Model | Technique | |
|---|---|---|
| LFM2-VL-1.6B | Supervised Fine Tuning (TRL) | |
| LFM2-VL-450M | Supervised Fine Tuning (TRL) |
Deploy to an edge device
The LEAP Edge SDK is our native framework for running LFM2 models on mobile devices.
Written for Android (Kotlin) and iOS (Swift), the goal of the Edge SDK is to make Small Language Model deployment as easy as calling a cloud LLM API endpoint, for any app developer.
| Platform | Example | |
|---|---|---|
| Android | LeapChat: A comprehensive chat application with real-time token streaming, persistent message history, and modern chat UI featuring message bubbles and typing indicators | 🤖 Tutorial |
| SloganApp: Single turn generation for marketing. The UI is implemented with Android Views. | 🤖 Tutorial | |
| ShareAI: Website summary generator | ▶️ Go to the code | |
| Recipe Generator: Structured output generation with the LEAP SDK | ▶️ Go to the code | |
| Visual Language Model example | ▶️ Go to the code | |
| iOS | LeapChat: A comprehensive chat application demonstrating advanced LeapSDK features including real-time streaming, conversation management, and modern UI components. | ▶️ Go to the code |
| LeapSloganExample: A simple SwiftUI app demonstrating basic LeapSDK integration for text generation. | ▶️ Go to the code | |
| Recipe Generator: Structured output generation | ▶️ Go to the code | |
| Audio demo: A SwiftUI app demonstrating audio input and output with the LeapSDK for on-device AI inference. | ▶️ Go to the code |
End-2-end Tutorials
Complete end-to-end tutorials that take you from setup to deployment.
| Tutorial | Repository |
|---|---|
| Super fast and accurate image classification on edge devices | ▶️ Go to the repo |
| Let's build a Chess game using small and local Large Language Models | ▶️ Go to the repo |
Examples built by our community
Working applications that demonstrate Liquid models in action.
| Project | Repository |
|---|---|
| TranslatorLens: Building An Offline Translation Camera | ▶️ Go to the repo |
| Food Images Fine-tuning | ▶️ Go to the repo |
| Meeting Intelligence CLI | ▶️ Go to the repo |
| Private Doc Q&A: On-device document Q&A with RAG and voice input | ▶️ Go to the repo |
Contributing
We welcome contributions!
- Open a PR with a link to your project github repo in the
Examples built by our communitysection.