fix: recipe scan 503 — three cf-orch config bugs + DocuvisionClient API mismatch #136

Closed
opened 2026-05-16 12:13:41 -07:00 by pyr0ball · 0 comments
Owner

Root Cause (actual — 3 bugs in cf-orch config + 1 in kiwi client)

1. Wrong model_id in assignments.yaml

kiwi.recipe_scan was assigned bartowski--qwen2-vl-7b-instruct-gguf which resolved to the cf-text service (port 8009). cf-text has no /extract endpoint, causing 404 → 503 fallthrough. Fixed to deepseek-ocr-2 (cf-docuvision).

2. Wrong module path for cf-docuvision in heimdall.yaml

args_template referenced circuitforge_core.resources.docuvision.app (does not exist). Correct path: circuitforge_orch.docuvision.app. Service crashed with ModuleNotFoundError on every start attempt.

3. Hardcoded nonexistent model path

cf-docuvision catalog entry had a hardcoded path to a non-existent GGUF file. Fixed: catalog now uses deepseek-ocr-2 entry pointing at HF-format avocet/models/deepseek-ai--DeepSeek-OCR-2 with {model} template substitution. VRAM updated to 7000 MB (6.4 GB FP16 + overhead).

4. DocuvisionClient API field name mismatch

Client sent {"image": b64} but docuvision ExtractRequest expects image_b64. Also read data.get("text") but response field is raw_text. Both fixed in app/services/ocr/docuvision_client.py.

Changes

circuitforge-orch:

  • profiles/assignments.yamlkiwi.recipe_scan + kiwi.ocr model_id: deepseek-ocr-2
  • profiles/nodes/heimdall.yaml — cf-docuvision: correct module path, {model} substitution, max_mb 7000, deepseek-ocr-2 catalog entry

kiwi:

  • app/services/ocr/docuvision_client.pyimage_b64 field, raw_text response field, timeout 120s
  • app/services/recipe/recipe_scanner.py — two-step pipeline: docuvision OCR → LLMRouter structuring; progress_cb threading; _build_ocr_extraction_prompt() helper
  • app/api/endpoints/recipe_scan.py — added POST /recipes/scan/stream SSE endpoint for cold-start progress feedback
  • frontend/src/services/api.tsscanStream() using fetch + ReadableStream
  • frontend/src/components/RecipeScanModal.vue — live phase labels during scan

Note on original diagnosis

The original ticket cited cf-vision with no managed: block. The actual failing service was cf-docuvision (distinct from cf-vision) with three independent config bugs. cf-vision is a separate service not used by kiwi.

## Root Cause (actual — 3 bugs in cf-orch config + 1 in kiwi client) ### 1. Wrong model_id in assignments.yaml `kiwi.recipe_scan` was assigned `bartowski--qwen2-vl-7b-instruct-gguf` which resolved to the cf-text service (port 8009). cf-text has no `/extract` endpoint, causing 404 → 503 fallthrough. Fixed to `deepseek-ocr-2` (cf-docuvision). ### 2. Wrong module path for cf-docuvision in heimdall.yaml `args_template` referenced `circuitforge_core.resources.docuvision.app` (does not exist). Correct path: `circuitforge_orch.docuvision.app`. Service crashed with ModuleNotFoundError on every start attempt. ### 3. Hardcoded nonexistent model path cf-docuvision catalog entry had a hardcoded path to a non-existent GGUF file. Fixed: catalog now uses `deepseek-ocr-2` entry pointing at HF-format `avocet/models/deepseek-ai--DeepSeek-OCR-2` with `{model}` template substitution. VRAM updated to 7000 MB (6.4 GB FP16 + overhead). ### 4. DocuvisionClient API field name mismatch Client sent `{"image": b64}` but docuvision ExtractRequest expects `image_b64`. Also read `data.get("text")` but response field is `raw_text`. Both fixed in `app/services/ocr/docuvision_client.py`. ## Changes **circuitforge-orch:** - `profiles/assignments.yaml` — `kiwi.recipe_scan` + `kiwi.ocr` model_id: `deepseek-ocr-2` - `profiles/nodes/heimdall.yaml` — cf-docuvision: correct module path, `{model}` substitution, max_mb 7000, deepseek-ocr-2 catalog entry **kiwi:** - `app/services/ocr/docuvision_client.py` — `image_b64` field, `raw_text` response field, timeout 120s - `app/services/recipe/recipe_scanner.py` — two-step pipeline: docuvision OCR → LLMRouter structuring; `progress_cb` threading; `_build_ocr_extraction_prompt()` helper - `app/api/endpoints/recipe_scan.py` — added `POST /recipes/scan/stream` SSE endpoint for cold-start progress feedback - `frontend/src/services/api.ts` — `scanStream()` using fetch + ReadableStream - `frontend/src/components/RecipeScanModal.vue` — live phase labels during scan ## Note on original diagnosis The original ticket cited `cf-vision` with no `managed:` block. The actual failing service was `cf-docuvision` (distinct from `cf-vision`) with three independent config bugs. cf-vision is a separate service not used by kiwi.
pyr0ball added the
bug
label 2026-05-16 12:13:41 -07:00
pyr0ball changed title from bug: recipe scan returns 503 — blocked on cf-orch#65 (cf-vision no managed block) to fix: recipe scan 503 — three cf-orch config bugs + DocuvisionClient API mismatch 2026-05-16 14:46:17 -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: Circuit-Forge/kiwi#136
No description provided.