[PR #106] [MERGED] fix(sidecar): Replace native llama addon rebuilds with downloadable llama-server runtime #4469

Closed
opened 2026-10-22 04:07:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/106
Author: @ghost
Created: 4/19/2026
Status: ✅ Merged
Merged: 4/19/2026
Merged by: @SpicyMarinara

Base: main ← Head: fix/sidecar-model-gguf


📝 Commits (4)

  • a694926 Implement llama-server sidecar runtime
  • 099ffc5 Improve sidecar setup modal flow
  • fc3e468 Fix sidecar installed state in connections panel
  • 044f9f8 Fix sidecar install state in download modal

📊 Changes

19 files changed (+2249 additions, -1962 deletions)

View changed files

📝 package.json (+1 -3)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+1 -1)
📝 packages/client/src/components/modals/ModelDownloadModal.tsx (+313 -180)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+12 -51)
📝 packages/client/src/stores/sidecar.store.ts (+224 -93)
📝 packages/server/package.json (+0 -1)
📝 packages/server/src/app.ts (+6 -0)
📝 packages/server/src/routes/generate.routes.ts (+2 -1)
📝 packages/server/src/routes/sidecar.routes.ts (+107 -68)
➕ packages/server/src/services/sidecar/sidecar-download.ts (+165 -0)
📝 packages/server/src/services/sidecar/sidecar-inference.service.ts (+202 -273)
📝 packages/server/src/services/sidecar/sidecar-model.service.ts (+335 -194)
➕ packages/server/src/services/sidecar/sidecar-process.service.ts (+313 -0)
➕ packages/server/src/services/sidecar/sidecar-runtime.service.ts (+526 -0)
📝 packages/shared/src/types/sidecar.ts (+42 -24)
📝 pnpm-lock.yaml (+0 -951)
📝 start-termux.sh (+0 -39)
📝 start.bat (+0 -44)
📝 start.sh (+0 -39)

📄 Description

Summary

This replaces the old node-llama-cpp sidecar path with a downloaded llama-server runtime and keeps the local-model flow working without native compilation on end-user machines.

It also adds support for using curated Gemma presets or custom GGUFs from HuggingFace, plus a clearer setup flow in the download modal.

Why

The previous sidecar flow depended on rebuilding native llama bindings locally, which was fragile across user machines and especially painful on Windows and other environments without the right toolchain.

This change moves Marinara to the official upstream llama.cpp server binaries instead:

  • no local C++ build step
  • no node-llama-cpp dependency
  • cleaner crash isolation via subprocess
  • easier support for newer llama.cpp model/runtime updates
  • better platform coverage

What changed

Server

  • Replaced in-process sidecar inference with a spawned llama-server subprocess
  • Added runtime install management for official llama.cpp release assets
  • Added runtime detection/status reporting
  • Added BYO GGUF listing + download flow from HuggingFace repos
  • Migrated sidecar config to explicit modelPath
  • Preserved sidecar inference API shape for existing callers where possible
  • Added restart/unload/health handling for the sidecar process
  • Added cleanup for legacy sidecar runtime stamp behavior

Client

  • Updated sidecar store for new runtime/model lifecycle states
  • Added runtime-aware modal UI for:
    • curated model downloads
    • custom HuggingFace GGUF selection
    • active setup progress
    • runtime/server error visibility
  • Disabled finishing setup until the sidecar is actually ready
  • Added a clearer “setup in progress” flow with cancel behavior while runtime/model startup is happening

Launcher / packaging

  • Removed sidecar native rebuild steps from:
    • start.bat
    • start.sh
    • start-termux.sh
  • Removed node-llama-cpp from package manifests and lockfile
  • Kept app versioning unchanged

Platform/runtime support

This runtime-selection flow now supports official download/install paths for:

  • Windows
  • macOS
  • Linux
  • Android/Termux

With runtime matching/fallback for available upstream variants such as:

  • CPU
  • CUDA
  • Vulkan
  • ROCm
  • ARM64 where upstream assets exist

User impact

Users should now be able to enable the local sidecar without needing to compile llama.cpp locally.

They can also:

  • keep using curated Gemma sidecar presets
  • use their own GGUF from a HuggingFace repo
  • see clearer setup progress while the runtime is downloading/starting

Validation

Ran:

  • pnpm --filter @marinara-engine/shared build
  • pnpm --filter @marinara-engine/server build
  • pnpm --filter @marinara-engine/client build

Manual:

  • verified the updated sidecar setup modal flow on the cleaned branch

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/106 **Author:** [@ghost](https://github.com/ghost) **Created:** 4/19/2026 **Status:** ✅ Merged **Merged:** 4/19/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `fix/sidecar-model-gguf` --- ### 📝 Commits (4) - [`a694926`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a694926004a0acfd8b228178da48b7c5e519a282) Implement llama-server sidecar runtime - [`099ffc5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/099ffc5effa0992ac013ae9a66ff589f203015be) Improve sidecar setup modal flow - [`fc3e468`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc3e468256e842ed57c6e99a0e1e5075dc6ba382) Fix sidecar installed state in connections panel - [`044f9f8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/044f9f8eb9d9fe05c3eff51c2589c571bf7561bd) Fix sidecar install state in download modal ### 📊 Changes **19 files changed** (+2249 additions, -1962 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -3) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+1 -1) 📝 `packages/client/src/components/modals/ModelDownloadModal.tsx` (+313 -180) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+12 -51) 📝 `packages/client/src/stores/sidecar.store.ts` (+224 -93) 📝 `packages/server/package.json` (+0 -1) 📝 `packages/server/src/app.ts` (+6 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+2 -1) 📝 `packages/server/src/routes/sidecar.routes.ts` (+107 -68) ➕ `packages/server/src/services/sidecar/sidecar-download.ts` (+165 -0) 📝 `packages/server/src/services/sidecar/sidecar-inference.service.ts` (+202 -273) 📝 `packages/server/src/services/sidecar/sidecar-model.service.ts` (+335 -194) ➕ `packages/server/src/services/sidecar/sidecar-process.service.ts` (+313 -0) ➕ `packages/server/src/services/sidecar/sidecar-runtime.service.ts` (+526 -0) 📝 `packages/shared/src/types/sidecar.ts` (+42 -24) 📝 `pnpm-lock.yaml` (+0 -951) 📝 `start-termux.sh` (+0 -39) 📝 `start.bat` (+0 -44) 📝 `start.sh` (+0 -39) </details> ### 📄 Description ## Summary This replaces the old `node-llama-cpp` sidecar path with a downloaded `llama-server` runtime and keeps the local-model flow working without native compilation on end-user machines. It also adds support for using curated Gemma presets or custom GGUFs from HuggingFace, plus a clearer setup flow in the download modal. ## Why The previous sidecar flow depended on rebuilding native llama bindings locally, which was fragile across user machines and especially painful on Windows and other environments without the right toolchain. This change moves Marinara to the official upstream `llama.cpp` server binaries instead: - no local C++ build step - no `node-llama-cpp` dependency - cleaner crash isolation via subprocess - easier support for newer llama.cpp model/runtime updates - better platform coverage ## What changed ### Server - Replaced in-process sidecar inference with a spawned `llama-server` subprocess - Added runtime install management for official `llama.cpp` release assets - Added runtime detection/status reporting - Added BYO GGUF listing + download flow from HuggingFace repos - Migrated sidecar config to explicit `modelPath` - Preserved sidecar inference API shape for existing callers where possible - Added restart/unload/health handling for the sidecar process - Added cleanup for legacy sidecar runtime stamp behavior ### Client - Updated sidecar store for new runtime/model lifecycle states - Added runtime-aware modal UI for: - curated model downloads - custom HuggingFace GGUF selection - active setup progress - runtime/server error visibility - Disabled finishing setup until the sidecar is actually ready - Added a clearer “setup in progress” flow with cancel behavior while runtime/model startup is happening ### Launcher / packaging - Removed sidecar native rebuild steps from: - `start.bat` - `start.sh` - `start-termux.sh` - Removed `node-llama-cpp` from package manifests and lockfile - Kept app versioning unchanged ## Platform/runtime support This runtime-selection flow now supports official download/install paths for: - Windows - macOS - Linux - Android/Termux With runtime matching/fallback for available upstream variants such as: - CPU - CUDA - Vulkan - ROCm - ARM64 where upstream assets exist ## User impact Users should now be able to enable the local sidecar without needing to compile llama.cpp locally. They can also: - keep using curated Gemma sidecar presets - use their own GGUF from a HuggingFace repo - see clearer setup progress while the runtime is downloading/starting ## Validation Ran: - `pnpm --filter @marinara-engine/shared build` - `pnpm --filter @marinara-engine/server build` - `pnpm --filter @marinara-engine/client build` Manual: - verified the updated sidecar setup modal flow on the cleaned branch --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:52 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4469
No description provided.