mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #538] [MERGED] Fix llama.cpp embedding response parsing #4660
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#4660
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/538
Author: @cha1latte
Created: 5/7/2026
Status: ✅ Merged
Merged: 5/7/2026
Merged by: @cha1latte
Base:
main← Head:fix/issue-534-llama-cpp-embeddings📝 Commits (1)
899e5baFix llama.cpp embedding response parsing📊 Changes
2 files changed (+32 additions, -2 deletions)
View changed files
📝
packages/server/src/services/llm/base-provider.ts(+16 -2)➕
packages/server/test/embedding-response.test.ts(+16 -0)📄 Description
Linked issue
Closes #534
Why this change
/embeddingsresponse can be a top-level array of{ embedding }items, while Marinara only accepted the OpenAI/v1/embeddings{ data: [...] }wrapper and crashed withCannot read properties of undefined (reading 'map').What changed
{ data: [{ embedding }] }responses and llama.cpp[{ embedding }]responses are accepted.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm --dir packages/server exec tsx ..\..\scratch\issue-534-embed-repro.tsagainst a local mock llama.cpp-style/embeddingsendpoint. Before the fix it returned{"ok":false,"error":"Cannot read properties of undefined (reading 'map')"}.{"ok":true,"embeddings":[[0.1,0.2,0.3]]}.pnpm --dir packages/server exec tsx --test test\embedding-response.test.ts: 3 tests passed, covering OpenAI wrapper responses, llama.cpp top-level array responses, and malformed response error paths.pnpm check: passed.Docs and release impact
UI evidence (if applicable)
N/A - backend/provider response parsing fix; no visible UI state changed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.