Shared scaffold for CircuitForge products
Closes #33, #37, #38, #41, #42. ## cf-text (closes #41) - New module: `circuitforge_core.text` — direct local inference bypassing ollama/vllm - Backends: llama.cpp (GGUF), transformers (HF), mock - Auto-detects backend from file extension; CF_TEXT_BACKEND env override - Optional 4-bit/8-bit quantisation via bitsandbytes (CF_TEXT_4BIT / CF_TEXT_8BIT) - process-level singleton + per-request `make_backend()` path ## Pipeline crystallization engine (closes #33, #37) - FPGA→ASIC model: LLM-discovered paths → deterministic workflows after N approvals - `models.py`: PipelineRun (incl. review_duration_ms + output_modified per #37), CrystallizedWorkflow, Step, hash_input() - `recorder.py`: append-only JSON run log under ~/.config/circuitforge/pipeline/ - `crystallizer.py`: threshold check, majority/most-recent step strategy, rubber-stamp warning (review_duration_ms < 5s triggers warnings.warn) - `registry.py`: exact + fuzzy match, deactivate-without-delete, colon-safe filenames - `executor.py`: deterministic steps with transparent LLM fallback ## Multimodal chunked pipeline (closes #42) - `pipeline/multimodal.py`: cf-docuvision pages → cf-text streaming - `run()` yields PageResult per page (progressive, no full-doc buffer) - `stream()` yields (page_idx, token) tuples for token-level UI rendering - `vram_serialise` flag + `swap_fn` hook for 8GB GPU VRAM management - `prompt_fn` callback for product-specific prompt construction ## Accessibility preferences (closes #38) - `preferences/accessibility.py`: PREF_REDUCED_MOTION, PREF_HIGH_CONTRAST, PREF_FONT_SIZE, PREF_SCREEN_READER with get/set helpers - Exported from preferences package __init__ ## LLM router fix - cf-orch backends: skip reachability pre-check; allocation starts the service - Static backends: reachability check remains in place |
||
|---|---|---|
| .forgejo/workflows | ||
| circuitforge_core | ||
| docker | ||
| tests | ||
| .cliff.toml | ||
| .gitignore | ||
| CHANGELOG.md | ||
| Dockerfile.orch | ||
| pyproject.toml | ||
| README.md | ||
circuitforge-core
Shared scaffold for CircuitForge products.
Current version: 0.7.0
Modules
Implemented
circuitforge_core.db— SQLite connection factory and migration runnercircuitforge_core.llm— LLM router with fallback chain (Ollama, vLLM, Anthropic, OpenAI-compatible)circuitforge_core.tiers— Tier system with BYOK and local vision unlockscircuitforge_core.config— Env validation and .env loadercircuitforge_core.hardware— Hardware detection and LLM backend profile generation (VRAM tiers, GPU/CPU auto-select)circuitforge_core.documents— Document ingestion pipeline: PDF, DOCX, and image OCR →StructuredDocumentcircuitforge_core.affiliates— Affiliate URL wrapping with opt-out, BYOK user IDs, and CF env-var fallback (wrap_url)circuitforge_core.preferences— User preference store (local YAML file, pluggable backend); dot-path get/set APIcircuitforge_core.tasks— VRAM-aware LLM task scheduler; shared slot manager across services (TaskScheduler)circuitforge_core.manage— Cross-platform product process manager (Docker and native modes)circuitforge_core.resources— Resource coordinator and agent: VRAM allocation, eviction engine, GPU profile registry
Stubs (in-tree, not yet implemented)
circuitforge_core.vision— Vision router base class (planned: moondream2 / Claude vision dispatch)circuitforge_core.wizard— First-run wizard base class (products subclassBaseWizard)circuitforge_core.pipeline— Staging queue base (StagingDB; products provide concrete schema)
Install
pip install -e .
License
BSL 1.1 — see LICENSE