Skip to content

feat(ai): add InferenceBackend trait and deterministic Fake - #103

Merged
McanKul merged 1 commit into
McanKul:epic/local-ai-runtimefrom
nonamexishere:feat/81-inference-adapter
Sep 10, 2026
Merged

McanKul merged 1 commit into
McanKul:epic/local-ai-runtimefrom
nonamexishere:feat/81-inference-adapter

Conversation

@nonamexishere

Copy link
Copy Markdown
Contributor

Summary

Adds a small Rust InferenceBackend seam (load / unload / generate / cancel / status / health) plus an in-process deterministic Fake so cancel, fail, and health can be tested without a real model. Product code does not import llama.cpp / candle / ort. No Tauri commands, no network, no model download.

Fixes #81.

Why

Parent #76 and epic #80 need a place to plug a local runtime later. This fold is the isolation layer only: Fake is UTF-8 prompt → UTF-8 text; FAIL / SLOW drive AI_* and CANCELLED. Model store, Settings UI, and PDF ingest stay out.

Validation

  • cargo test --manifest-path src-tauri/Cargo.toml --lib ai_ (11 passed)
  • npm test / npm run typecheck / cargo test --lib on epic/local-ai-runtime

Privacy Checklist

  • This keeps OffPDF usable offline.
  • This does not upload, log, or transmit user files.
  • New dependencies or bundled binaries have compatible licenses. (none added)

Isolate product code from a future local runtime. Fake load/unload/
generate/cancel/status/health need no model. Failures map to AppError.
No Tauri commands, no network, no inference crate.

@McanKul McanKul left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — this keeps the runtime boundary isolated and testable without exposing an unfinished model integration.

@McanKul
McanKul merged commit 338ada6 into McanKul:epic/local-ai-runtime Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants