Shared scaffold for CircuitForge products
Five backends: BGE (FlagEmbedding), Qwen3 (generative yes/no logit scorer, batched forward pass), CrossEncoder (sentence-transformers, covers mxbai-rerank / ms-marco / jina), Cohere (BYOK cloud), Remote (HTTP delegate to cf-reranker service). Mock adapter for tests. 54 tests. cf-reranker FastAPI service app (port 8011) — cf-orch manages as a process, defaults to Qwen3-Reranker-0.6B. make_reranker() auto-detects CF_ORCH_URL and routes to cf-orch cf-reranker when set — cloud apps (Kiwi, Peregrine, Snipe) get remote Qwen3 reranking with zero code changes. Local dev falls back to local BGE. pyproject extras: reranker-bge, reranker-qwen3, reranker-cross-encoder, reranker-cohere, reranker-service. |
||
|---|---|---|
| .forgejo/workflows | ||
| circuitforge_core | ||
| docker | ||
| docs | ||
| scripts | ||
| tests | ||
| .cliff.toml | ||
| .gitignore | ||
| CHANGELOG.md | ||
| Dockerfile.orch | ||
| LICENSE | ||
| mkdocs.yml | ||
| 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