Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
cache: npm
cache-dependency-path: web/package-lock.json
- uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de
with:
toolchain: '1.95.0'
Expand All @@ -25,6 +30,9 @@ jobs:
- run: make lint
- run: make test
- run: make test-client
- run: cd web && npx playwright install --with-deps chromium
- run: make web-test-browser
- run: cd web && npm audit --omit=dev --audit-level=high
- run: cargo doc --locked --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
14 changes: 14 additions & 0 deletions .github/workflows/spark-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
cache: npm
cache-dependency-path: web/package-lock.json
- uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de
with:
toolchain: '1.95.0'
Expand All @@ -25,6 +30,9 @@ jobs:
- run: make lint-spark
- run: make test
- run: make test-client
- run: cd web && npx playwright install --with-deps chromium
- run: make web-test-browser
- run: cd web && npm audit --omit=dev --audit-level=high
build:
needs: contract
runs-on: ubuntu-24.04
Expand All @@ -33,6 +41,11 @@ jobs:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
cache: npm
cache-dependency-path: web/package-lock.json
- uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de
with:
toolchain: '1.95.0'
Expand All @@ -53,6 +66,7 @@ jobs:
- name: Build ARM64 appliance
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
make web-build
cargo auditable zigbuild --locked --release --target aarch64-unknown-linux-gnu --features appliance --bin sparkplane
scripts/package-spark-release.sh target/aarch64-unknown-linux-gnu/release/sparkplane target/release-assets/appliance
cargo metadata --locked --format-version 1 > target/release-assets/appliance/cargo-metadata.json
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ __pycache__/
*.key
*.minisig
.env
/web/node_modules/
/web/dist/
/web/test-results/
/web/playwright-report/
/web/*.tsbuildinfo
/.config/sparkplane/spark-launch.lock
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
.PHONY: build test lint lint-spark test-client fmt-check audit update
build:
.PHONY: build test lint lint-spark test-client fmt-check audit update web-build web-check web-test web-test-browser
.DEFAULT_GOAL := build
web/node_modules/.sparkplane-deps: web/package.json web/package-lock.json
cd web && npm ci --no-fund
touch web/node_modules/.sparkplane-deps
web-build: web/node_modules/.sparkplane-deps
cd web && npm run build
web-check: web/node_modules/.sparkplane-deps
cd web && npm run check
web-test: web/node_modules/.sparkplane-deps
cd web && npm test
web-test-browser: web-build
cd web && npm run test:browser
cargo test --locked --features appliance --lib browser_authentication_redirects_over_https -- --ignored
build: web-build
cargo build --locked --release --features appliance
test:
test: web-build web-test
python3 tests/standalone_contract.py
python3 tests/spark_update.py
cargo test --locked --workspace --all-targets --features appliance
test-client:
cargo test --locked --no-default-features --all-targets
lint:
lint: web-build web-check
cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets --features appliance -- -D warnings
cargo clippy --locked --no-default-features --all-targets -- -D warnings
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cargo build --locked --release
./target/release/sparkplane dgx-spark status --json
./target/release/sparkplane dgx-spark serve qwen3.8:flash-next --dry-run --json
./target/release/sparkplane dgx-spark launch codex
./target/release/sparkplane webui
```

Use the pinned Rust 1.95.0 toolchain (selected automatically by rustup), a
Expand All @@ -26,8 +27,9 @@ within a supported sandbox. See [launch permissions](docs/reference/spark.md#int

Launches also default to `--eco-mode=max`, using RTK filters embedded in the
Sparkplane executable. Use `--eco-mode=none` to disable compression. When the
coding session exits, Sparkplane prints token usage and public cloud price
comparisons; `sparkplane <host> economics --json` reads the latest retained report.
coding session exits, Sparkplane prints token usage and the same model's public
cloud-equivalent cost when a verified tariff exists; `sparkplane <host> economics
--json` reads the latest retained report.
See [session economics](docs/reference/spark.md#eco-mode-and-session-economics).

Vision launches also retain recent images automatically and archive older
Expand All @@ -47,11 +49,22 @@ executor, database, gateway and bootstrap implementation. The owned
`sparkplane-core` and `sparkplane-ipc` crates contain only platform vocabulary,
trace propagation, notification and bounded IPC.

The web panel uses shadcn/ui with a black and NVIDIA-green theme. Run
`sparkplane webui` to open it and click **Authenticate**, using your existing
CLI credential. The local authentication service stops after login. If you
open `/panel/` directly, run `sparkplane webauthsvc start` on the browser's
computer. See [web panel](docs/reference/spark.md#web-panel).

Appliance builds additionally need Node.js 22.12+ and npm to compile the panel:
run `make web-build` before invoking Cargo with `--features appliance`.
Compiled assets are embedded in the signed binary; Spark needs no Node runtime.

```sh
make lint
make test
make test-client
make audit
make web-test-browser # first: cd web && npx playwright install chromium
cargo build --locked --release --features appliance
```

Expand Down
50 changes: 50 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
use std::{env, fs, path::Path};

fn main() {
if env::var_os("CARGO_FEATURE_APPLIANCE").is_none() {
return;
}
println!("cargo:rerun-if-changed=web/dist");
let root = env::current_dir().expect("repository").join("web/dist");
assert!(
root.join("index.html").exists(),
"panel assets missing: run `make web-build` before building the appliance"
);
let mut files = Vec::new();
collect(&root, &mut files);
files.sort();
let mut generated = String::from("static ASSETS: &[(&str, &[u8], &str)] = &[\n");
for file in files {
let relative = file.strip_prefix(&root).unwrap().to_str().unwrap();
let mime = match file.extension().and_then(|s| s.to_str()) {
Some("html") => "text/html; charset=utf-8",
Some("js") => "text/javascript; charset=utf-8",
Some("css") => "text/css; charset=utf-8",
Some("svg") => "image/svg+xml",
Some("png") => "image/png",
Some("woff2") => "font/woff2",
_ => "application/octet-stream",
};
generated.push_str(&format!(
"({relative:?}, include_bytes!({:?}), {mime:?}),\n",
file.to_str().unwrap()
));
}
generated.push_str("];\n");
fs::write(
Path::new(&env::var_os("OUT_DIR").unwrap()).join("panel_assets.rs"),
generated,
)
.unwrap();
}

fn collect(path: &Path, files: &mut Vec<std::path::PathBuf>) {
for entry in fs::read_dir(path).unwrap() {
let path = entry.unwrap().path();
if path.is_dir() {
collect(&path, files);
} else {
files.push(path);
}
}
}
1 change: 1 addition & 0 deletions configs/apparmor.d/sparkplane-executor
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ profile sparkplane-executor /opt/sparkplane/current/sparkplane flags=(attach_dis
/var/lib/sparkplane/huggingface/** r,
/proc/*/cgroup r,
/proc/*/stat r,
/proc/stat r,
/proc/meminfo r,
/proc/vmstat r,
/proc/pressure/memory r,
Expand Down
5 changes: 5 additions & 0 deletions configs/sparkplane/agent.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ allowed_client_cidrs = ["10.1.30.0/24"]
plain_http_loopback_only = true
executor_socket = "/run/sparkplane/executor.sock"

[webui]
enabled = true
# Optional exact HTTPS origin; otherwise use the certificate's DNS/IP identities.
# origin = "https://10.1.30.143:9843"

[gateway]
# Public uploads are normalized to the selected engine's stricter image policy.
request_body_bytes = 33554432
Expand Down
41 changes: 17 additions & 24 deletions data/economics-prices.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
{
"version": "2026-09-30.1",
"version": "2026-10-01.1",
"currency": "USD",
"tariff": "standard_uncached",
"models": [
{
"model": "gpt-6.1-sol",
"source": "https://developers.openai.com/api/docs/models/gpt-6.1-sol",
"verified_at": "2026-09-30",
"effective_from": "2026-09-30",
"input_microusd_per_million": 2000000,
"output_microusd_per_million": 10000000,
"long_context_threshold": 272000,
"long_input_microusd_per_million": 4000000,
"long_output_microusd_per_million": 15000000
},
{
"model": "claude-sonnet-4-6",
"source": "https://platform.claude.com/docs/en/models/sonnet-4-6/overview",
"verified_at": "2026-09-30",
"effective_from": "2026-09-30",
"input_microusd_per_million": 3000000,
"output_microusd_per_million": 15000000,
"model": "qwen3.8-flash-next",
"aliases": ["qwen/qwen3.8-flash-next", "qwen3.8:flash-next", "qwen3.8:flash-next-nvfp4", "qwen3.8:flash-next-iq4-xs", "Qwen/Qwen3.8-Flash-Next", "RadixArk/Qwen3.8-Flash-Next-NVFP4", "unsloth/Qwen3.8-Flash-Next-GGUF"],
"provider": "Lyceum",
"source": "https://lyceum.technology/products/inference/models/qwen/qwen3.8-flash-next/",
"verified_at": "2026-10-01",
"effective_from": "2026-10-01",
"input_microusd_per_million": 200000,
"output_microusd_per_million": 500000,
"long_context_threshold": null,
"long_input_microusd_per_million": null,
"long_output_microusd_per_million": null
},
{
"model": "gemini-3.5-flash",
"source": "https://ai.google.dev/gemini-api/docs/pricing",
"verified_at": "2026-09-30",
"effective_from": "2026-09-30",
"input_microusd_per_million": 1500000,
"output_microusd_per_million": 9000000,
"model": "qwen3.8-27b",
"aliases": ["qwen/qwen3.8-27b", "qwen3.8:27b", "qwen3.8:27b-q4-k-m", "qwen3.8:27b-fp8", "Qwen/Qwen3.8-27B", "Qwen/Qwen3.8-27B-FP8", "ggml-org/Qwen3.8-27B-GGUF"],
"provider": "Lyceum",
"source": "https://lyceum.technology/products/inference/models/qwen/qwen3.8-27b/",
"verified_at": "2026-10-01",
"effective_from": "2026-10-01",
"input_microusd_per_million": 400000,
"output_microusd_per_million": 2400000,
"long_context_threshold": null,
"long_input_microusd_per_million": null,
"long_output_microusd_per_million": null
Expand Down
10 changes: 10 additions & 0 deletions docs/how-to/develop-spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,22 @@ the workstation update helper also reads the installed public release key over S

## Local development loop

Install Node.js 22.12+ and npm for appliance development. The web panel's exact
dependencies are recorded in `web/package-lock.json`. `make lint`, `make test`
and `make build` compile it automatically; a direct Cargo appliance build needs
`make web-build` first. Client-only Cargo builds and `make test-client` need no
Node tooling. The panel assets are embedded inside the existing signed executable,
so the signed release inventory remains unchanged.

Run the same checks that gate the release before opening a pull request:

```bash
make lint
make test
make test-client
make audit
cd web && npx playwright install chromium && cd ..
make web-test-browser
RUSTDOCFLAGS='-D warnings' cargo doc --locked --workspace --all-features --no-deps
```

Expand Down Expand Up @@ -152,6 +161,7 @@ python3 -m pip install --user ziglang==0.16.0
Build locally with the same feature boundary as Spark:

```bash
make web-build
cargo auditable zigbuild --locked --release \
--target aarch64-unknown-linux-gnu \
--no-default-features --features appliance --bin sparkplane
Expand Down
Loading
Loading