mlx-community/LFM2-350M-4bit
Run locally on Apple devices with Mirai
- Type
- local
- From
- LiquidAI
- Quantization
- MLX 4-bit
- Parameters
- 350M
- Size
- 195.0 MB
A 4-bit quantized version of LiquidAI's LFM2-350M, converted to Apple's MLX format for efficient on-device inference on Apple Silicon hardware. This community conversion was produced using `mlx-lm` v0.26.0.
Origin & Architecture
LFM2-350M is part of Liquid AI's second-generation Liquid Foundation Model family, purpose-built for edge deployment. At just 350 million parameters — further compressed via 4-bit quantization — this variant is exceptionally lightweight, making it well-suited for resource-constrained environments like laptops, phones, and embedded applications.
Multilingual Text Generation
The model supports text generation across eight languages: English, Arabic, Chinese, French, German, Japanese, Korean, and Spanish. This broad multilingual coverage in such a compact model makes it a compelling option for lightweight, polyglot applications.
Key Highlights
- Ultra-compact footprint: 350M parameters with 4-bit quantization yields a very small memory and storage profile.
- MLX-native: Optimized for Apple's MLX framework, enabling fast inference on M-series chips with minimal setup.
- Edge-first design: Part of Liquid AI's "edge" model line, balancing capability with extreme efficiency.
- Chat-ready: Includes a chat template, supporting conversational use out of the box.
Use Cases
This model is ideal for developers building on-device assistants, lightweight multilingual text tools, or prototyping generative applications where low latency and minimal resource consumption are priorities. Its small size also makes it a practical choice for experimentation and rapid iteration on Apple Silicon machines.
Provenance
- Base model: LiquidAI/LFM2-350M
- Converted by: mlx-community
- License: LFM 1.0 (custom license from Liquid AI)
spm https://github.com/trymirai/uzu.git
| 1 | import Uzu |
| 2 | |
| 3 | public func runChat() async throws { |
| 4 | let engineConfig = EngineConfig.create() |
| 5 | let engine = try await Engine.create(config: engineConfig) |
| 6 | |
| 7 | guard let model = try await engine.model(identifier: "mlx-community/LFM2-350M-4bit") else { |
| 8 | return |
| 9 | } |
| 10 | for try await update in try await engine.download(model: model).iterator() { |
| 11 | print("Download progress: \(update.progress())") |
| 12 | } |
| 13 | |
| 14 | let messages = [ |
| 15 | ChatMessage.system().withText(text: "You are a helpful assistant"), |
| 16 | ChatMessage.user().withText(text: "Tell me a short, funny story about a robot") |
| 17 | ] |
| 18 | let session = try await engine.chat(model: model, config: .create()) |
| 19 | let stream = await session.replyWithStream(input: messages, config: .create()) |
| 20 | var message: ChatMessage? = nil |
| 21 | for try await update in stream.iterator() { |
| 22 | switch update { |
| 23 | case .replies(let replies): |
| 24 | message = replies.last?.message |
| 25 | case .error(let error): |
| 26 | print("Error: \(error)") |
| 27 | } |
| 28 | } |
| 29 | print("Text: \(message?.text() ?? "empty")") |
| 30 | } |