feat: add foundation models plugin with server management capabilities#7744
Conversation
|
Hi, @louis-jan |
|
@dev-miro26 is there a way to hide the provider when the device is "NOT_ELIGIBLE"? |
|
@louis-jan |
ab8d938 to
38e4574
Compare
|
Hi, @louis-jan Could you review this PR again? |
|
Sure. Will check |
|
Hi, @louis-jan
|
|
It looks great, I think we can polish it a bit. cc @Vanalite |
f3bd4e1 to
ed901fb
Compare
|
Hi, @louis-jan |
|
@dev-miro26 @Vanalite should we polish the provider and model name a bit? The provider plugin / extension should have Product Name / icon? |
|
Will merge after CI gets passed |
|
Hi, @louis-jan |
|
@dev-miro26 gave it some more tests, seems like it could not perform a tool call, can you help take a look.
|
|
@louis-jan |
|
@dev-miro26 you can try tool use, see issues in the screenshot. |
|
@dev-miro26 Is it possible to use this to wrap the server in a Tauri plugin? So that we can get rid of the Apple Foundation model server in Swift. |
|
@louis-jan |
|
@dev-miro26 can you check this https://lib.rs/crates/apple-foundation-models |
|
@louis-jan Is this right? |
|
Yes! Exactly |
|
@louis-jan |
|
@louis-jan |
|
Yes please @dev-miro26 thank you |





New components
foundation-models-server/— Swift CLI that wraps FoundationModels.frameworkand exposes an OpenAI-compatible HTTP API (health, /v1/models, /v1/chat/completions).
Checks
SystemLanguageModel.default.availabilityat startup and exits with adescriptive error when Apple Intelligence is not available.
src-tauri/plugins/tauri-plugin-foundation-models/— Rust Tauri plugin thatmanages the server process lifecycle (spawn, readiness polling, graceful shutdown).
Returns structured error codes for all unavailability reasons
(
DEVICE_NOT_ELIGIBLE,APPLE_INTELLIGENCE_NOT_ENABLED,MODEL_NOT_READY).extensions/foundation-models-extension/— JanAIEngineextension. Exposesthe model as
apple/on-device. Delegates streaming and non-streaming chat to thelocal server over localhost, following the same HTTP proxy pattern as
mlx-extension.Changes to existing files
src-tauri/Cargo.tomlfoundation-modelsoptional feature + depsrc-tauri/src/lib.rssrc-tauri/capabilities/desktop.jsonfoundation-models:defaultpermissionsrc-tauri/tauri.macos.conf.jsonfoundation-models-serverbinaryMakefilebuild-foundation-models-server+-if-existstargets with codesignpackage.jsonFixes Issues
Self Checklist
### How to test