{"id":43671239,"url":"https://github.com/hyodotdev/locanara","last_synced_at":"2026-03-02T23:06:16.630Z","repository":{"id":336455955,"uuid":"1147011776","full_name":"hyodotdev/locanara","owner":"hyodotdev","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-13T09:32:20.000Z","size":2401,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-13T15:39:19.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyodotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-01T03:28:10.000Z","updated_at":"2026-02-10T21:13:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hyodotdev/locanara","commit_stats":null,"previous_names":["hyodotdev/locanara"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hyodotdev/locanara","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Flocanara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Flocanara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Flocanara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Flocanara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyodotdev","download_url":"https://codeload.github.com/hyodotdev/locanara/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Flocanara/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-05T00:05:16.478Z","updated_at":"2026-02-18T22:02:29.265Z","avatar_url":"https://github.com/hyodotdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Locanara\n\n![Locanara](logo.png)\n\nOn-Device AI Framework for iOS and Android\n\n[![License](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](LICENSE)\n\n---\n\n## Overview\n\nLocanara is an on-device AI framework inspired by LangChain, purpose-built for mobile. Build, compose, and extend AI features using platform-native models — all processing happens locally on the device.\n\nNo cloud. No data leaves. Privacy by design.\n\n**Documentation**: [locanara.com](https://locanara.com)\n\n---\n\n## Supported Platforms\n\n### iOS / macOS\n\n| Engine | Description | Requirements |\n|--------|-------------|--------------|\n| Apple Intelligence | OS-level Foundation Models | iOS 18.1+ / macOS 15.1+ (iOS 26+ / macOS 26+ recommended), Apple Silicon, 7GB+ free space |\n| llama.cpp | GGUF models with Metal GPU acceleration | iOS 17+ / macOS 14+, Apple Silicon |\n| CoreML | Neural Engine accelerated inference | iOS 17+ / macOS 14+, Apple Silicon |\n| MLX | Apple Silicon optimized inference | macOS 14+, Apple Silicon |\n\n### Android\n\n| Engine | Description | Requirements |\n|--------|-------------|--------------|\n| Gemini Nano | ML Kit GenAI (Prompt API) | Android 14+ (API 34+) |\n| ExecuTorch | Meta's on-device inference runtime | Android 12+ (API 31+) |\n\n\u003e Locanara automatically detects device capabilities and routes inference to the best available engine.\n\n---\n\n## Why Locanara?\n\nMost on-device AI SDKs give you raw model access. Locanara gives you a **framework** — composable chains, memory management, guardrails, and a pipeline DSL — so you can build production AI features, not just call a model.\n\n### Three Levels of API\n\n1. **Simple** — One-liner convenience methods for common tasks\n2. **Chain** — Configurable built-in chains with typed results\n3. **Custom** — Implement the Chain protocol for app-specific AI features\n\n### Architecture\n\n```text\n┌─────────────────────────────────────────────┐\n│  Runtime Layer                              │\n│  Agent · Session · ChainExecutor            │\n├─────────────────────────────────────────────┤\n│  Built-in Chains                            │\n│  Summarize · Classify · Chat · Translate ·  │\n│  Extract · Rewrite · Proofread              │\n├─────────────────────────────────────────────┤\n│  Composable Layer                           │\n│  Chain · Tool · Memory · Guardrail          │\n├─────────────────────────────────────────────┤\n│  Core Layer                                 │\n│  LocanaraModel · PromptTemplate ·           │\n│  OutputParser · Schema                      │\n├─────────────────────────────────────────────┤\n│  DSL Layer                                  │\n│  Pipeline · PipelineStep · ModelExtensions  │\n├─────────────────────────────────────────────┤\n│  Platform Layer                             │\n│  FoundationLanguageModel · PromptApiModel   │\n├─────────────────────────────────────────────┤\n│  Engine Layer                               │\n│  InferenceRouter · LlamaCppEngine ·         │\n│  ExecuTorchEngine · DeviceCapabilityDetector│\n├─────────────────────────────────────────────┤\n│  ModelManager Layer                         │\n│  ModelManager · ModelDownloader ·           │\n│  ModelRegistry · ModelStorage               │\n├─────────────────────────────────────────────┤\n│  RAG Layer                                  │\n│  VectorStore · DocumentChunker ·            │\n│  EmbeddingEngine · RAGQueryEngine           │\n├─────────────────────────────────────────────┤\n│  Personalization Layer                      │\n│  PersonalizationManager · FeedbackCollector │\n│  PreferenceAnalyzer · PromptOptimizer       │\n└─────────────────────────────────────────────┘\n```\n\n---\n\n## Installation\n\n**iOS (Swift Package Manager)**\n\n```text\nhttps://github.com/hyodotdev/locanara\n```\n\n**Android (Gradle)**\n\n```groovy\nimplementation(\"com.locanara:locanara:1.0.0\")\n```\n\n---\n\n## Key Features\n\n### Framework Layer\n\n- **Chain** — Composable unit of AI logic with typed input/output\n- **Pipeline DSL** — Compose chains with compile-time type safety\n- **Memory** — BufferMemory (last N turns) and SummaryMemory (compressed history)\n- **Guardrail** — Input/output validation and content filtering\n- **Tool** — External capability integration for agents\n\n### Built-in Chains\n\n7 ready-to-use chains, each returning typed results:\n\n| Chain | Result Type | Description |\n|-------|-------------|-------------|\n| SummarizeChain | SummarizeResult | Text summarization |\n| ClassifyChain | ClassifyResult | Text classification |\n| ExtractChain | ExtractResult | Entity extraction |\n| ChatChain | ChatResult | Conversational AI with memory |\n| TranslateChain | TranslateResult | Language translation |\n| RewriteChain | RewriteResult | Text rewriting by style |\n| ProofreadChain | ProofreadResult | Grammar correction |\n\n### Engine System\n\n- **InferenceEngine** — Unified protocol for all inference backends\n- **InferenceRouter** — Automatic engine selection based on device capabilities\n- **DeviceCapabilityDetector** — Hardware detection (NPU, memory, chipset)\n- **MemoryManager** — Intelligent memory allocation for model loading\n\n### Model Management\n\n- **ModelManager** — Download, load, and manage on-device models\n- **ModelRegistry** — Available model catalog with metadata\n- **ModelDownloader** — Background download with progress tracking\n- **ModelStorage** — Local storage and cache management\n\n### RAG (Retrieval-Augmented Generation)\n\n- **VectorStore** — Local vector storage for embeddings\n- **DocumentChunker** — Text splitting with configurable strategies\n- **EmbeddingEngine** — On-device embedding generation\n- **RAGQueryEngine** — Similarity search and context retrieval\n\n### Personalization\n\n- **FeedbackCollector** — Collect user feedback on AI outputs\n- **PreferenceAnalyzer** — Learn user preferences over time\n- **PromptOptimizer** — Adapt prompts based on user behavior\n\n### Runtime Layer\n\n- **ChainExecutor** — Instrumented execution with retry and history\n- **Session** — Stateful conversation management\n- **Agent** — ReAct-lite autonomous agent with tools\n\n---\n\n## Packages\n\n- [**apple**](packages/apple) — iOS/macOS SDK\n  [![GitHub Release](https://img.shields.io/github/v/release/hyodotdev/locanara?filter=apple-*\u0026label=SPM)](https://github.com/hyodotdev/locanara/releases?q=apple\u0026expanded=true)\n  [![CocoaPods](https://img.shields.io/cocoapods/v/Locanara?label=CocoaPods)](https://cocoapods.org/pods/Locanara)\n  [![CI iOS](https://github.com/hyodotdev/locanara/actions/workflows/ci-ios.yml/badge.svg)](https://github.com/hyodotdev/locanara/actions/workflows/ci-ios.yml)\n\n- [**android**](packages/android) — Android SDK\n  [![Maven Central](https://img.shields.io/maven-central/v/com.locanara/locanara?label=Maven%20Central)](https://central.sonatype.com/artifact/com.locanara/locanara)\n  [![CI Android](https://github.com/hyodotdev/locanara/actions/workflows/ci-android.yml/badge.svg)](https://github.com/hyodotdev/locanara/actions/workflows/ci-android.yml)\n\n- [**site**](packages/site) — Website + Documentation → [locanara.com](https://locanara.com)\n\n---\n\n## Requirements\n\n**iOS / macOS**\n\n- **Minimum**: iOS 17+ / macOS 14+ (llama.cpp, CoreML engines)\n- **Apple Intelligence**: iOS 18.1+ / macOS 15.1+ (iOS 26+ / macOS 26+ recommended)\n  - Requires Apple Silicon (A17 Pro+ for iPhone, M1+ for Mac)\n  - Requires 7GB+ free storage space\n- Apple Silicon device required for all engines\n\n**Android**\n\n- **Minimum**: Android 12+ (API 31+) for ExecuTorch engine\n- **Full**: Android 14+ (API 34+) for Gemini Nano engine\n- Device with NPU support recommended\n\n---\n\n## License\n\nAGPL-3.0 License — see [LICENSE](./LICENSE) for details.\n\n---\n\n*Built with conviction that AI should run where your data lives — on your device.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyodotdev%2Flocanara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyodotdev%2Flocanara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyodotdev%2Flocanara/lists"}