mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2835] [Issue]: Curated sidecar GGUF download fails because approximate sizeBytes is validated as an exact byte count #1435
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1435
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JM1k1 on GitHub (Jun 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2835
Curated sidecar GGUF download fails because rounded sizeBytes is used for exact validation
Summary
When downloading the curated sidecar model
gemma-4-E2B-it-Q8_0.gguf, Marinara-Engine rejects the downloaded file at the final size validation step:I may be missing some project-specific context, and I have not audited the entire codebase. However, from the sidecar-related files I checked, it looks like the curated model metadata stores approximate / rounded file sizes, while the download path later treats that same value as an exact byte count.
Expected behavior
The curated Q8 sidecar model should download successfully, pass validation, be saved as the active local model (for agents), and successfully process a local test message.
Actual behavior
The download completes with
5048350848bytes received, but Marinara-Engine expects5400000000bytes and rejects the file with a size mismatch error.This happened for me both when running from source and when using the launcher. I also tried both Node.js v26.3.1 and Node.js v24 LTS, and the behavior did not change.
Steps to reproduce
gemma-4-E2B-it-Q8_0.ggufAfter the download finishes, the model is rejected with:
Environment
What I found
At first I assumed
sizeBytesmight only be used as an approximate display value, because the type comment says:However, the curated GGUF presets currently contain rounded-looking values:
To verify the remote file size, I checked the file metadata exposed by the Hugging Face Hub API for the models used in the curated sidecar metadata.
The metadata returned by Hugging Face reports:
gemma-4-E2B-it-Q8_0.gguf: 5048350848 bytes
gemma-4-E2B-it-Q4_K_M.gguf: 3106731392 bytes
That exact value,
5048350848, is also the value Marinara-Engine reports as “received” in the error message.So the current values appear to differ like this:
I reproduced the failure with Q8_0. I did not separately reproduce the full Q4_K_M download failure, but the same kind of metadata mismatch appears to be present there too.
Why I think this causes the failure
In
sidecar-model.service.ts, the curated model’ssizeBytesvalue is passed into the downloader asexpectedBytes:The same
sizeBytesvalue is also used when deciding whether an existing local model file is usable:Then, in
sidecar-download.ts,expectedBytesis used as an exact byte count. After the temporary download finishes, the file size is compared directly against that value:So, as I understand it, the flow is:
This also explains why the error says:
The expected value appears to come from the curated preset metadata, while the received value matches the remote file size reported by Hugging Face.
Local verification
As a local sanity check, I changed only the Q8 byte value in the sidecar metadata to match the remote file size reported by Hugging Face, rebuilt the app, and retried the same download. After that, the model downloaded successfully and the local model started:
@SpicyMarinara commented on GitHub (Jun 23, 2026):
On it.