I need a custom iPhone keyboard that acts like a writing assistant: it should suggest context‑aware sentence completions and offer one‑tap rewrites (more formal or more concise). It also needs a clipboard history with fast search and a code‑snippet drawer to save and quickly insert frequently used blocks. All intelligence must run fully on‑device for privacy and offline use—no network calls. Build it as a keyboard extension in Swift/SwiftUI organized with MVC; if third‑party components are needed, use CocoaPods. Please provide the overall architecture and the key implementation details (model loading/inference inside the extension, UI flow, data storage, and snippet insertion).