An iOS app for on-device fine-tuning and inference of compact RWKV models — no data ever leaves the device. Models, datasets, and trained weights are pulled from a Hugging Face catalog (ImpulseLeap/neuromodels, ImpulseLeap/neurodatasets); training and inference both run locally via SwiftRWKV (the RWKVGen package) on MLX.
- iOS 26.5
- Xcode 26.5
- Apple Silicon Mac (M-series) — for building and running the simulator/device
App target root.
NeuroApp.swift—@mainentry point, TelemetryDeck initialization.RemoteCatalog.swift— catalog source of truth: Hugging Face API calls for the model collection (ImpulseLeap/neuromodels) and dataset collection (ImpulseLeap/neurodatasets), resolving URLs to a given repo'sconfig.json/ weights / tokenizer.CatalogStore.swift— state for the "Catalog" tab: fetching the list viaRemoteCatalog, downloading model/dataset files (FileDownloader— aURLSessionDownloadDelegatewith progress reporting and redirect handling).ModelStore.swift— model package description (ModelConfig: architecture, layer count, embedding size, tokenizer, task type, etc.), reading/writing packages on disk — both downloaded base models (models/) and the user's fine-tuned ones (mymodels/).Dataset.swift— loads training examples from.jsonl(from the app bundle or fromDocuments/datasets/<id>/), tokenizes and truncates tomaxLen.ChatScreens.swift— chat data models (Chat,ChatMessage) and the associated Combine/UI helpers for the model conversation screen.
Inference and preprocessing layer, no UI.
BPETokenizer.swift— byte-level BPE tokenizer for the Hugging Facetokenizer.jsonformat (GPT-2 style): reads the vocabulary and merge rules, byte↔unicode table, encodes text into tokens.Inference.swift—InferenceEngine: wires the backbone model, tokenizer, and trained head (Linear) into a single text-classification pipeline, returning aPrediction(winning label + per-class probability distribution).Pooling.swift— strategies for pooling backbone outputs into a single vector before the head:mean(masked average over real tokens) andlast(vector of the last real token).
UI, four tab-bar tabs (RootTabView.swift): Home, Train, Chats, Catalog.
RootTabView.swift— rootTabViewand the "Catalog" tab (CatalogView) with a Models/Datasets segment switch.HomeView.swift/HomeStore.swift/HomeComponents.swift— "Home" tab: usage summary, lists of the user's own/downloaded models and datasets, reusable visual components (tiles, cards).FinetuneView.swift— fine-tuning setup form: base model and dataset selection, training level (TrainLevel: simple → aggressive), which determines the learning rate and the number of frozen layers.TrainingProcessView.swift/TrainingRunner.swift— training process screen and its engine:TrainingRunnerloads the backbone/tokenizer/dataset and runsX070PartialFinetune(from SwiftRWKV) in the background, publishing progress, loss, and phase (extracting→training→done/failed) to the main thread.ChatsView.swift— chat list (pin/rename/delete) and navigation into a conversation with a specific fine-tuned model.DetailSheets.swift— detail sheet for a user model / base model / dataset (metadata, accuracy, size, etc.).Theme.swift— color palette (wrapper over Assets.xcassets) and app typography.Localizable.xcstrings— localization strings (RU/EN).
App icon, color sets used by Theme.swift, other graphic resources.
GitHub Actions CI/CD pipeline (macos-26): checks out Neuro and SwiftRWKV side by side (at the path expected by the local Swift Package dependency), pulls the Metal Toolchain, builds, and uploads the build to App Store Connect on a release-* tag.
- SwiftRWKV (
RWKVGen) — RWKV-7 inference and fine-tuning on MLX - MLX — tensor computation on Apple Silicon
- TelemetryDeck — anonymous usage analytics
Licensed under the Apache License, Version 2.0. See LICENSE for the full text.
Alexei Goncharov