feat: hardware detection, cf-docuvision service, documents ingestion pipeline #14

Merged
pyr0ball merged 1 commit from feature/hardware-docuvision into main 2026-04-02 18:55:51 -07:00
Owner

Summary

  • #5 Hardware moduledetect_hardware(), select_tier(), generate_profile() mapping physical GPU → LLMConfig; VRAM tier ladder from CPU to 24 GB
  • #8 cf-docuvision service — FastAPI wrapper for ByteDance/Dolphin-v2; ProcessSpec managed: blocks wired into all four GPU profiles (6/8/16/24 GB)
  • #7 Documents moduleingest(image_bytes, hint)StructuredDocument; cf-docuvision primary path with LLMRouter vision fallback; CF_DOCUVISION_URL env override
  • #13 Coordinator probe loop tests — 4 async tests for _run_instance_probe_loop (healthy, timeout, cleanup, no-url)

Test plan

  • pytest tests/test_hardware/ — 31 tests (tiers, generator, detect)
  • pytest tests/test_resources/test_docuvision.py — 14 tests
  • pytest tests/test_resources/test_coordinator_probe.py — 4 tests
  • pytest tests/test_documents/ — 22 tests
  • Full suite: 216 passed

Closes #5, #7, #8, #13

## Summary - **#5 Hardware module** — `detect_hardware()`, `select_tier()`, `generate_profile()` mapping physical GPU → LLMConfig; VRAM tier ladder from CPU to 24 GB - **#8 cf-docuvision service** — FastAPI wrapper for ByteDance/Dolphin-v2; ProcessSpec `managed:` blocks wired into all four GPU profiles (6/8/16/24 GB) - **#7 Documents module** — `ingest(image_bytes, hint)` → `StructuredDocument`; cf-docuvision primary path with `LLMRouter` vision fallback; `CF_DOCUVISION_URL` env override - **#13 Coordinator probe loop tests** — 4 async tests for `_run_instance_probe_loop` (healthy, timeout, cleanup, no-url) ## Test plan - [ ] `pytest tests/test_hardware/` — 31 tests (tiers, generator, detect) - [ ] `pytest tests/test_resources/test_docuvision.py` — 14 tests - [ ] `pytest tests/test_resources/test_coordinator_probe.py` — 4 tests - [ ] `pytest tests/test_documents/` — 22 tests - [ ] Full suite: 216 passed Closes #5, #7, #8, #13
pyr0ball added 1 commit 2026-04-02 18:53:47 -07:00
Closes #5, #7, #8, #13

## hardware module (closes #5)
- HardwareSpec, LLMBackendConfig, LLMConfig dataclasses
- VramTier ladder (CPU / 2 / 4 / 6 / 8 / 16 / 24 GB) with select_tier()
- generate_profile() maps HardwareSpec → LLMConfig for llm.yaml generation
- detect_hardware() with nvidia-smi / rocm-smi / system_profiler / cpu fallback
- 31 tests across tiers, generator, and detect

## cf-docuvision service (closes #8)
- FastAPI service wrapping ByteDance/Dolphin-v2 (Qwen2.5-VL backbone)
- POST /extract: image_b64 or image_path + hint → ExtractResponse
- Lazy model loading; JSON-structured output with plain-text fallback
- ProcessSpec managed blocks added to all four GPU profiles (6/8/16/24 GB)
- 14 tests

## documents module (closes #7)
- StructuredDocument, Element, ParsedTable dataclasses (frozen, composable)
- DocuvisionClient: thin HTTP client for cf-docuvision POST /extract
- ingest(): primary cf-docuvision path → LLMRouter vision fallback → empty doc
- CF_DOCUVISION_URL env var for URL override
- 22 tests

## coordinator probe loop (closes #13)
- _run_instance_probe_loop: starting → running on 200; starting → stopped on timeout
- 4 async tests with CancelledError-based tick control
pyr0ball merged commit 1de5ec767c into main 2026-04-02 18:55:51 -07:00
Sign in to join this conversation.
No reviewers
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/circuitforge-core#14
No description provided.