Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bun tauri build --target universal-apple-darwin

#### Linux: ONNX Runtime Setup

Linux builds bundle ONNX Runtime 1.23.2 for local TTS and PDF OCR. `just desktop-build` provisions it automatically. Before invoking `bun tauri build` directly, download the pinned shared library:
Linux builds bundle ONNX Runtime 1.23.2 for PDF OCR. `just desktop-build` provisions it automatically. Before invoking `bun tauri build` directly, download the pinned shared library:

```bash
cd frontend/src-tauri
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# iOS ONNX Runtime Local Development Guide

This guide explains how to build and test the iOS ONNX Runtime used by local TTS and PDF OCR on the iOS Simulator or a physical device.
This guide explains how to build and test the iOS ONNX Runtime used by PDF OCR on the iOS Simulator or a physical device.

## Overview

Maple pins ONNX Runtime 1.23.2 and links it statically on iOS for both TTS and PDF OCR. ONNX Runtime is built from source because:
Maple pins ONNX Runtime 1.23.2 and links it statically on iOS for PDF OCR. ONNX Runtime is built from source because:
1. Pre-built binaries from HuggingFace are missing Abseil symbols
2. We need both device (arm64) and simulator (arm64) builds
3. The simulator build requires a workaround for a libiconv linking bug
Expand Down Expand Up @@ -165,4 +165,4 @@ rm -rf frontend/src-tauri/onnxruntime-build frontend/src-tauri/onnxruntime-ios
## Related Documentation

- [troubleshooting-ios-build.md](./troubleshooting-ios-build.md) - arm64-sim architecture fix
- [tts-research.md](./tts-research.md) - TTS implementation details
- [pdf-ocr.md](./pdf-ocr.md) - PDF extraction and OCR architecture
4 changes: 2 additions & 2 deletions docs/pdf-ocr.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Maple pins [OpenSecretCloud's `pdf_oxide` maintenance commit](https://github.com

## One inference runtime

PDF OCR and desktop/iOS TTS use one Rust binding (`ort = 2.0.0-rc.11`) and one Microsoft ONNX Runtime version (1.23.2). Maple does not ship tract.
PDF OCR uses the Rust binding `ort = 2.0.0-rc.11` and Microsoft ONNX Runtime 1.23.2. Maple does not ship tract.

The runtime is part of the application package; users do not download it when opening a PDF:

Expand All @@ -18,7 +18,7 @@ The runtime is part of the application package; users do not download it when op
| Android | Microsoft's official Android AAR, with `libonnxruntime.so` staged for arm64-v8a, armeabi-v7a, x86, and x86_64. |
| iOS | A deterministic device/simulator XCFramework built from the pinned Microsoft source commit and linked statically. |

Maple owns loader policy through PDFOxide's loader-neutral `ocr-ort` feature. Dynamic targets initialize the exact packaged library before either OCR or TTS creates a session. iOS initializes the same Rust API against its static library. Cargo resolves exactly one `ort` version per target.
Maple owns loader policy through PDFOxide's loader-neutral `ocr-ort` feature. Dynamic targets initialize the exact packaged library before OCR creates a session. iOS initializes the same Rust API against its static library. Cargo resolves exactly one `ort` version per target.

The application constructs and reuses one OCR engine. Native-only PDFs bypass model setup. OCR-routed pages are rendered once in full, bounded to a 2,000 by 2,000-pixel box, so tiled scans, inline images, and vector content do not depend on selecting one embedded image. Mixed pages retain native text and append OCR spans not already represented in the native layer. OCR remains optional enrichment for native-readable hybrid pages: if OCR is unavailable, Maple keeps the native text.

Expand Down
6 changes: 2 additions & 4 deletions docs/product-redesign-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ These are reachable from the logged-in product and should receive redesign polis
- `DeleteChatDialog`
- `BulkDeleteDialog`
- `WebSearchInfoDialog`
- `TTSDownloadDialog`
- `UpgradePromptDialog`
- `PromoDialog`
- `VerificationModal`
Expand Down Expand Up @@ -250,7 +249,7 @@ The new chat UI must still support:
- Document attachments
- Desktop/Tauri PDF support behavior
- Voice recording + transcription
- TTS playback/download behavior
- TTS playback behavior
- Cancel generation
- Fullscreen composer mode
- Pagination/loading older messages
Expand Down Expand Up @@ -278,7 +277,7 @@ Do not regress platform-specific handling already present in the app.
- Desktop vs mobile layout differences
- Tauri vs web link opening
- iOS-specific billing/API gating
- Tauri-only features such as local PDF/TTS flows
- Tauri-only features such as local PDF processing

## 4.7 Master-first reconciliation rule

Expand Down Expand Up @@ -1329,7 +1328,6 @@ Use PR #465 mostly as a semantic cleanup guide here.
- `ContextLimitDialog`
- `DeleteChatDialog`
- `BulkDeleteDialog`
- `TTSDownloadDialog`
- `VerificationModal`
- `GuestPaymentWarningDialog`

Expand Down
248 changes: 0 additions & 248 deletions docs/tts-research.md

This file was deleted.

25 changes: 1 addition & 24 deletions frontend/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 5 additions & 30 deletions frontend/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,18 @@ futures-util = "0.3"
sha2 = "0.10"

[target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "linux", target_os = "android"))'.dependencies]
# PDF OCR uses the same explicitly packaged ONNX Runtime as desktop TTS. The
# loader policy lives in Maple so iOS can retain static linkage below.
# PDF OCR uses Maple's explicitly packaged ONNX Runtime. The loader policy
# lives in Maple so iOS can retain static linkage below.
ort = { version = "=2.0.0-rc.11", default-features = false, features = ["std", "ndarray", "load-dynamic"] }

[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
# TTS dependencies (Supertonic) - desktop only
ndarray = { version = "0.17", features = ["rayon"] }
rand = "0.8.6"
rand_distr = "0.4"
hound = "3.5"
unicode-normalization = "0.1"
regex = "1.10"
dirs = "6.0"

[target.'cfg(target_os = "linux")'.dependencies]
ndarray = { version = "0.17", features = ["rayon"] }
rand = "0.8.6"
rand_distr = "0.4"
hound = "3.5"
unicode-normalization = "0.1"
regex = "1.10"
dirs = "6.0"

[target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "linux"))'.dependencies]
# Pin Goose to an exact official upstream commit. Keep this as a git dependency
# instead of a submodule so ordinary Maple checkouts do not need the full Goose
# history.
goose = { git = "https://github.com/aaif-goose/goose.git", rev = "c3111c71cd682ed1d115741677f0ca9946c51499", package = "goose", default-features = false }
goose-providers = { git = "https://github.com/aaif-goose/goose.git", rev = "c3111c71cd682ed1d115741677f0ca9946c51499", package = "goose-providers", default-features = false }
opensecret = "3.5.0"
rand = "0.8.6"
async-trait = "0.1"
rmcp = { version = "=1.4.0", default-features = false }
tauri-plugin-dialog = "2.7.1"
Expand All @@ -91,18 +73,11 @@ tempfile = "3"
libc = "0.2"

[target.'cfg(target_os = "ios")'.dependencies]
# TTS dependencies (Supertonic) - iOS
# We build ONNX Runtime 1.23.2 from source for iOS (see scripts/build-ios-onnxruntime.sh)
# We disable download-binaries and copy-dylibs since we link our own xcframework
# Need "std" for Error trait impl and file operations, "ndarray" for tensor creation
# PDF OCR needs "std" for Error trait impl and file operations, and "ndarray"
# for tensor creation.
ort = { version = "=2.0.0-rc.11", default-features = false, features = ["std", "ndarray"] }
ndarray = { version = "0.17" }
rand = "0.8.6"
rand_distr = "0.4"
hound = "3.5"
unicode-normalization = "0.1"
regex = "1.10"
dirs = "6.0"

[target.'cfg(target_os = "android")'.dependencies]
openssl = { version = "0.10.80", default-features = false, features = ["vendored"] }
Expand Down
4 changes: 2 additions & 2 deletions frontend/src-tauri/resources/windows/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Windows bundled runtime DLLs

Maple loads **ONNX Runtime 1.23.2** by explicit path before PDF OCR or TTS
creates a session. Windows also ships a Windows-ML
Maple loads **ONNX Runtime 1.23.2** by explicit path before PDF OCR creates a
session. Windows also ships a Windows-ML
`C:\Windows\System32\onnxruntime.dll` forwarder that may be an incompatible
version, so Maple must not rely on the ambient DLL search path.

Expand Down
Loading
Loading