Skip to content

Commit b413287

Browse files
committed
feat(onnx): add in-process plugin manifest
Add the ONNX Runtime plugin manifest with an explicit in-process installation type, ONNX model compatibility, runtime-profile and model-library panel declarations, and no version-manager or connection-url capability. This keeps ONNX metadata aligned with the Rust in-process session manager instead of pretending there is a binary or Python sidecar install path. Extend Rust and TypeScript plugin schemas to accept the in-process installation type, and add Rust schema coverage for both a minimal in-process fixture and the checked-in ONNX manifest. Update the ONNX Runtime serving plan with M3 plugin identity progress and the remaining frontend registry, Rust AppId/version-manager, and lifecycle follow-ups. Verification: cargo fmt --manifest-path rust/Cargo.toml --all -- --check; cargo test --manifest-path rust/crates/pumas-core/Cargo.toml plugins; npm run -w frontend check:types.
1 parent 9af6cf8 commit b413287

7 files changed

Lines changed: 110 additions & 6 deletions

File tree

docs/plans/onnx-runtime-embedding-serving/execution-and-coordination.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,18 @@ Update during implementation:
802802
`cargo info half@2.7.1`, `cargo info ndarray@0.17.2`, local `du` checks for
803803
source/build directories, and a local `find` check for copied
804804
`libonnxruntime*` artifacts under `rust/target`.
805+
- 2026-05-12: Started the M3 ONNX app/plugin identity contract with an
806+
in-process plugin manifest slice. `launcher-data/plugins/onnx-runtime.json`
807+
now declares ONNX Runtime as an enabled in-process runtime with no version
808+
manager, no connection URL, `.onnx` model compatibility, and runtime-profile
809+
plus ONNX model-library panel declarations. Rust and TypeScript plugin schema
810+
types now accept `installationType: "in-process"`, and Rust plugin schema
811+
tests parse both a minimal in-process fixture and the checked-in ONNX
812+
manifest. Frontend app registry/panel wiring, Rust `AppId`/version-manager
813+
alignment, and ONNX runtime-profile lifecycle remain separate M3/M6 slices.
814+
Verification passed: `cargo fmt --manifest-path rust/Cargo.toml --all
815+
-- --check`, `cargo test --manifest-path rust/crates/pumas-core/Cargo.toml
816+
plugins`, and `npm run -w frontend check:types`.
805817

806818
## Commit Cadence Notes
807819

docs/plans/onnx-runtime-embedding-serving/milestones.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ non-zero token usage without calling raw ONNX provider internals.
533533
Ollama or llama.cpp profiles.
534534

535535
**Tasks:**
536-
- [ ] Add `launcher-data/plugins/onnx-runtime.json`.
536+
- [x] Add `launcher-data/plugins/onnx-runtime.json`.
537537
- [x] Add `RuntimeProviderId::OnnxRuntime` and
538538
`RuntimeProviderMode::OnnxServe`.
539539
- [ ] Add ONNX Runtime to the frontend app registry with a sidebar icon,
@@ -604,9 +604,12 @@ Ollama or llama.cpp profiles.
604604
`.onnx` executable artifact support, an embedding-only ONNX provider behavior,
605605
an `in_process_runtime` managed launch target, and contract tests. Frontend
606606
runtime provider types/descriptors now include `onnx_runtime` and `onnx_serve`
607-
with focused descriptor tests and typecheck coverage. Plugin/app identity,
608-
frontend app state, ONNX runtime profile lifecycle, and full schema/fixture
609-
coverage remain open.
607+
with focused descriptor tests and typecheck coverage. Plugin metadata now
608+
includes `onnx-runtime` with an explicit `in-process` installation type,
609+
`.onnx` compatibility, runtime-profile/model-library panel declarations, no
610+
version-manager capability, and Rust/TypeScript plugin schema support. Frontend
611+
app state, Rust `AppId`/version-manager alignment, ONNX runtime profile
612+
lifecycle, and full schema/fixture coverage remain open.
610613

611614
### Milestone 4: Serving Validation And Load/Unload
612615

frontend/src/types/api-plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface PluginConfigResponse {
1313
description: string;
1414
icon?: string;
1515
githubRepo?: string;
16-
installationType: 'binary' | 'python-venv' | 'docker';
16+
installationType: 'binary' | 'in-process' | 'python-venv' | 'docker';
1717
capabilities: {
1818
hasVersionManagement: boolean;
1919
supportsShortcuts: boolean;

frontend/src/types/plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
/** How the app is installed and managed */
9-
export type InstallationType = 'binary' | 'python-venv' | 'docker';
9+
export type InstallationType = 'binary' | 'in-process' | 'python-venv' | 'docker';
1010

1111
/** App capabilities that affect available features */
1212
export interface AppCapabilities {

launcher-data/plugins/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Each manifest must describe one plugin by stable identifier, display name, execu
99
## Consumer Contract
1010
Consumers must parse manifests as structured data and reject missing required fields instead of applying ad hoc defaults.
1111

12+
`installationType: "in-process"` means the runtime is supplied by Pumas itself
13+
and must not be routed through binary, Python, Docker, or version-manager
14+
installation flows. ONNX Runtime uses this shape because embedding sessions are
15+
owned by the Rust process and exposed through backend runtime profiles plus the
16+
Pumas `/v1` gateway.
17+
1218
## Validation Contract
1319
Manifest validation should run in launcher or app-manager tests before manifests are packaged for release.
1420

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"id": "onnx-runtime",
3+
"displayName": "ONNX Runtime",
4+
"description": "In-process Rust ONNX Runtime embedding provider",
5+
"icon": "cpu",
6+
"installationType": "in-process",
7+
8+
"capabilities": {
9+
"hasVersionManagement": false,
10+
"supportsShortcuts": false,
11+
"hasDependencies": false,
12+
"hasConnectionUrl": false,
13+
"hasModelLibrary": true,
14+
"hasStats": false
15+
},
16+
17+
"modelCompatibility": {
18+
"supportedFormats": ["onnx"]
19+
},
20+
21+
"panelLayout": [
22+
{"type": "runtime_profiles", "config": {"provider": "onnx_runtime"}},
23+
{"type": "model_library", "config": {"filter": "onnx"}}
24+
],
25+
26+
"sidebarPriority": 22,
27+
"enabledByDefault": true
28+
}

rust/crates/pumas-core/src/plugins/schema.rs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use std::collections::HashMap;
1111
pub enum InstallationType {
1212
/// Standalone binary download (Ollama, etc.)
1313
Binary,
14+
/// Runtime is provided in-process by Pumas and has no version manager.
15+
InProcess,
1416
/// Python virtual environment (ComfyUI, etc.)
1517
PythonVenv,
1618
/// Docker container
@@ -234,6 +236,7 @@ impl PluginConfig {
234236
#[cfg(test)]
235237
mod tests {
236238
use super::*;
239+
use std::path::PathBuf;
237240

238241
#[test]
239242
fn test_deserialize_plugin() {
@@ -327,4 +330,56 @@ mod tests {
327330
assert!(config.supports_format("safetensors"));
328331
assert!(!config.supports_format("onnx"));
329332
}
333+
334+
#[test]
335+
fn test_deserialize_in_process_plugin() {
336+
let json = r#"{
337+
"id": "onnx-runtime",
338+
"displayName": "ONNX Runtime",
339+
"description": "In-process Rust ONNX Runtime embedding provider",
340+
"installationType": "in-process",
341+
"capabilities": {
342+
"hasVersionManagement": false,
343+
"hasConnectionUrl": false,
344+
"hasModelLibrary": true
345+
},
346+
"modelCompatibility": {
347+
"supportedFormats": ["onnx"]
348+
},
349+
"panelLayout": [
350+
{"type": "runtime_profiles", "config": {"provider": "onnx_runtime"}},
351+
{"type": "model_library", "config": {"filter": "onnx"}}
352+
],
353+
"sidebarPriority": 22
354+
}"#;
355+
356+
let config: PluginConfig = serde_json::from_str(json).unwrap();
357+
358+
assert_eq!(config.id, "onnx-runtime");
359+
assert_eq!(config.installation_type, InstallationType::InProcess);
360+
assert!(!config.capabilities.has_version_management);
361+
assert!(!config.capabilities.has_connection_url);
362+
assert!(config.capabilities.has_model_library);
363+
assert!(config.supports_format("onnx"));
364+
}
365+
366+
#[test]
367+
fn onnx_runtime_manifest_matches_in_process_contract() {
368+
let manifest_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
369+
.join("../../..")
370+
.join("launcher-data/plugins/onnx-runtime.json");
371+
let json = std::fs::read_to_string(manifest_path).unwrap();
372+
let config: PluginConfig = serde_json::from_str(&json).unwrap();
373+
374+
assert_eq!(config.id, "onnx-runtime");
375+
assert_eq!(config.display_name, "ONNX Runtime");
376+
assert_eq!(config.installation_type, InstallationType::InProcess);
377+
assert!(!config.capabilities.has_version_management);
378+
assert!(!config.capabilities.has_connection_url);
379+
assert!(config.supports_format("onnx"));
380+
assert!(config
381+
.panel_layout
382+
.iter()
383+
.any(|section| section.section_type == "runtime_profiles"));
384+
}
330385
}

0 commit comments

Comments
 (0)