-
Notifications
You must be signed in to change notification settings - Fork 1
Module llama cpp Roadmap
Roadmap-Hinweis: Vage Bullets ohne Akzeptanzkriterien in Checkbox-Tasks überführen. Format:
- [ ] <Task> (Target: <Q/Jahr>).
v2.2.0 — Real LlamaWrapper inference wired in behind THEMIS_LLM_ENABLED.
generate(), embed(), exportLoRA, and importLoRA all delegate to
LlamaWrapper when a non-empty model path is provided and the macro is set.
Stub mode (empty path / CI without model) is preserved as a transparent fallback.
-
THEMIS_LLM_PLUGIN()export macro -
LlamaCppPlugin : ILLMPlugin— full interface (generate, RAG, embed, LoRA, stats) -
loadModel/unloadModelwith stub mode and realLlamaWrapperinitialisation - Thread-safe LoRA registry (
std::mutex) -
getCapabilities()—supports_lora,supports_embeddings,plugin_version -
getMemoryStats()/getPerformanceStats()— JSON -
themis_llm_create/themis_llm_destroyC-linkage entry points - 50 unit tests (
LlamaCppPluginFocusedTests, groups A–N) - Plugin manifest + CMake registration
- Streaming token output via
InferenceRequest::stream_callback(v2.1.0) -
generateStream(request, callback)convenience method (v2.1.0) -
generateBatch(requests)batch inference method (v2.1.0) -
LlamaCppPluginRegistrar— PluginManager hot-plug integration (v2.1.0) -
getCapabilities().supports_streaming = true(v2.1.0) -
getCapabilities().supports_batching = true(v2.1.0) - Real llama.cpp inference via
LlamaWrapperbehindTHEMIS_LLM_ENABLED(v2.2.0) - Real embedding vectors via
LlamaWrapper::embed()(v2.2.0) -
exportLoRA/importLoRAdelegated toLlamaWrapper(v2.2.0) -
tests/CMakeLists.txtupdated — registrar + deps added for N1–N6 (v2.2.0)
(none — all previously in-progress items are now complete)
- Function/tool calling (Target: Q4 2026)
- Per-request cancellation token (Target: Q4 2026)
-
ILLMPlugininterface reviewed; all methods implemented
-
LlamaCppPluginstub with load/generate/embed/LoRA lifecycle - Real
LlamaWrapperdelegation behindTHEMIS_LLM_ENABLED(v2.2.0)
-
generate()returns error when model not loaded -
embed()returns empty when model not loaded - Thread-safe LoRA registry (duplicate id replacement)
-
generateStream()swallows callback exceptions; incrementserror_count_ -
generateBatch()propagates per-request errors without aborting the batch - Stub fallback when
LlamaWrapper::loadModel()fails (file not found, etc.) (v2.2.0)
- 50 unit tests across groups A–N
- 3 group-O structured-error tests (O1–O3): generate() without model loaded
- Registrar link fixed in
tests/CMakeLists.txt(v2.2.0)
- Real llama.cpp inference benchmark (
benchmarks/bench_llama_cpp_inference.cpp; stub path exercised in CI; 6 benchmark scenarios) (Target: Q3 2026) - Concurrency test P1: 8 threads × 10
generate()calls — no race, no deadlock (Target: Q3 2026) - Concurrency test P2: 4 threads concurrent
generateBatch(5)— correct response count (Target: Q3 2026) - Concurrency test P3: interleaved
loadLoRA()+generate()from 6 threads — all succeed (Target: Q3 2026)
- README, CHANGELOG, ROADMAP, ARCHITECTURE, FUTURE_ENHANCEMENTS, AUDIT, SECURITY
-
inference_count_/error_count_converted tostd::atomic<uint64_t>— lock-free reads (A1) -
stream_retry_count_added asstd::atomic<uint64_t>— exposed ingetPerformanceStats()(A1) -
generateRAG()data-race fixed: shared state (model_loaded_,context_length_) snapshotted under mutex at entry (A2) -
generateStream()stream-callback retry: up to 3 attempts for transient exceptions;bad_allocnon-retryable;stream_retry_count_incremented per transient retry (D1) -
thread_join_no_timeoutfindings triaged as false positives; no helper retained because the module has no owned join sites (D2) -
importLoRAGGUF magic-bytes check (0x47 0x47 0x55 0x46) + 2 GB size bound — fail-closed (B2) -
loadModel()opt-in model-file integrity gate viaverify_model_digest+expected_model_digestconfig keys (B3) -
setPolicyFn(PolicyFn)— pluggable inference policy hook;generate()/generateRAG()gate on denial (B4) -
LlamaCppPluginRegistrar::initFromServerConfig(server_config)— server-startup integration point; readsconfig["llm"]["model_path"](C1) -
defaultReloadCallback()fixed — callsloadModel()when path present; returnstruein stub mode (C2) - LLCPG-1..4 release gate benchmarks added (TTFT, batch-embed, LoRA-load P99, regression baseline) (E1)
- Tests Groups U (concurrency, 4), V (security, 6), W (registrar integration, 8), X (retry/join, 3) — 21 new tests (Q3 2026)
- Unit tests present (89 tests: groups A–X)
- Stub mode for CI without model file
- Thread-safe LoRA registry
- Capabilities correctly reported
-
context_lengthread from config JSON (n_ctx/context_lengthkeys, fallback 4096) -
ModelInfo::context_lengthpopulated from config onloadModel() -
generateRAG()usesRAGContextAssembler— no naive document concatenation -
InferenceRequest::max_tokenscapped byRAGContextAssembler::computeMaxTokens() -
generateStream()honours callback with 3-attempt transient-exception retry -
generateBatch()preserves request order in response vector -
LlamaCppPluginRegistrarprovides PluginManager hot-plug integration -
LlamaCppPluginRegistrar::initFromServerConfig()provides server-startup integration point - Real llama.cpp inference wired in (
THEMIS_LLM_ENABLED) - Real embeddings via
LlamaWrapper::embed()with L2 normalisation -
exportLoRA/importLoRAdelegated toLlamaWrapper;importLoRAGGUF-validated before delegation - Concurrency hardening verified: 8-thread generate(), 4-thread generateBatch(), 6-thread LoRA+generate() race — all pass (P1–P3)
-
inference_count_/error_count_/stream_retry_count_arestd::atomic<uint64_t>— lock-free reads -
generateRAG()shared-state data-race eliminated (mutex snapshot at entry) -
supports_function_call = true; tool-call stub synthesised in test/stub mode; tools forwarded through bridge path (S1–S3) - Per-request cancellation token (
InferenceRequest::cancellation_token); pre-inference check returnssuccess=false/"Request cancelled"(T1–T2) - Model file integrity check: opt-in via
"verify_model_digest": true+"expected_model_digest"config keys - LoRA adapter integrity: GGUF magic bytes + 2 GB size bound validated in
importLoRA - Inference policy gate:
setPolicyFn(fn)pluggable hook; denial returnssuccess=false - LLCPG-1..4 release gate benchmarks present (TTFT, batch-embed throughput, LoRA P99, regression baseline)
-
generateBatch()is sequential; true parallel batch requires real llama.cpp. - Stub mode is active when compiled without
THEMIS_LLM_ENABLEDor when the model path is empty / the file does not exist.
v2.1.0 — getCapabilities().plugin_version changed from "2.0.0" to "2.1.0".
getPluginVersion() similarly returns "2.1.0".
Stand: 2026-08-09 – Quelle: [[src/UNUSED_FUNCTIONS_REPORT.md|UNUSED-FUNCTIONS-REPORT]]
-
LlamaCppPlugin– LLM-Plugin-Implementierung für llama.cpp; vollständig implementiert (generate,embed,generateRAG,generateStream,generateBatch, LoRA-Lifecycle, Memory/Performance-Stats, Policy-Gate, Security-Validation). 89 Unit-Tests + Benchmark vorhanden.
✅ Produktionslücke geschlossen (v2.4.0):
LlamaCppPluginRegistrar::initFromServerConfig(server_config)ist als sauberer Server-Startup-Integrationspunkt implementiert. Der Server-Startup-Code kannLlamaCppPluginRegistrar::initFromServerConfig(config)aufrufen, umLlamaCppPluginin denLLMPluginManagerzu registrieren, wennconfig["llm"]["model_path"]gesetzt ist.defaultReloadCallback()delegiert nun korrekt anloadModel()statt eines Stub-Kommentars.
This module is a contributing module in the program-level Wave A → B → C → D execution model.
It does not own a primary wave deliverable but must remain release_critical-green throughout all waves
and must deliver Wave D operability improvements in Q1 2027.
See [[../../ROADMAP.md|ROADMAP]] for the full wave model and exit criteria.
- Deliver or validate distributed tracing, high-cardinality stress coverage, exporter reliability, and operator remediation hints as applicable to this module (Target: Q1 2027)
- Contribute to or validate long-duration soak test coverage for this module's primary paths (Target: Q1 2027)
- Ensure runbook coverage for operator-critical scenarios in this module (Target: Q1 2027)
-
release_criticalCI must remain green ondevelopthroughout all waves (Target: ongoing) - p95/p99 benchmarks must be refreshed on representative hardware before Wave D sign-off (Target: Q1 2027)
- No behavioral regression may be introduced into modules in Wave A/B/C scope from changes in this module.
- This module's distributed/acceleration paths fail closed (Target: Q1 2027)
- Benchmark-backed p95/p99 baselines exist on representative hardware (Target: Q1 2027)
- Operator-critical paths have diagnostics, alerts, and runbooks (Target: Q1 2027)
- Architecture-ACCESS-MODEL-IMPLEMENTATION-SUMMARY
- Architecture-ADR-003-pg-dump-sql-parser
- Architecture-BASEENTITY-PRINCIPLE
- Architecture-CACHE-STORAGE-INTEGRATION
- Architecture-CMAKE-ARCHITECTURE
- Architecture-CMAKE-FLAGS-REFERENCE
- Architecture-CMAKE-MODULAR-ARCHITECTURE
- Architecture-CONCERNS-ARCHITECTURE-DIAGRAM
- Architecture-CONCERNS-IMPLEMENTATION-SUMMARY
- Architecture-CONTENT-MODEL
- Architecture-COPILOT-THEMISDB-GRAPH-RAG-BACKEND-ARCHITECTURE
- Architecture-CRYPTO-AND-KEYS
- Architecture-FEATURE-FLAGS-REFERENCE
- Architecture-GPU-ARCHITECTURE-REVIEW-TEMPLATE
- Architecture-HTTP-SHUTDOWN-HARDENING
- Architecture-MIGRATION-GUIDE-CONCERNS
- Architecture-MIGRATION-GUIDE-v13-v14
- Architecture-MODULARIZATION-GUIDE
- Architecture-MODULAR-ARCHITECTURE-ROADMAP
- Architecture-MODULE-ARCHITECTURE-INDEX
- Architecture-P1D01-ISSMPLUGIN-DESIGN-REVIEW
- Architecture-P1-D01-ISSMPLUGIN-DESIGN-REVIEW
- Architecture-P1-D08-MAMBA-GOVERNANCE-CONTRACT
- Architecture-P1-P2-IMPLEMENTATION-COMPLETION-INDEX
- Architecture-PHASE0-COMPLETION-ASSESSMENT
- Architecture-PHASE3-QUERYENGINE-DI-ARCHITECTURE
- Architecture-PHASE4-INDEX-MANAGER-DI
- Architecture-POSTGRESQL-WIRE-PROTOCOL
- Architecture-QUERYENGINE-IMPLEMENTATION-GUIDE
- Architecture-QUERY-SCHEDULING
- Architecture-RAFT-CONSENSUS-DESIGN
- Architecture-README
- Architecture-README-SSM-HYBRID-IMPLEMENTATION
- Architecture-REFACTORING-SUMMARY
- Architecture-RESOURCE-POOLING
- Architecture-SOURCE-DIRECTORY-GUIDE
- Architecture-THEMIS-CORE-GUIDE
- Architecture-UNIFIED-ACCESS-MODEL
- Architecture-WAL-GRPC-MTLS-CONFIGURATION
- Architecture-WIRE-PROTOCOL-RETRY
- Architecture-boltzmann-observability-draft
- Architecture-experimental-logarithmic-vector-storage
- Architecture-llm-wiki-mvp-adr
- Architecture-rewrite-engine-architecture
- Architecture-rope-api-architecture
- Architecture-ssm-gguf-mamba-status
- Architecture-ssm-hybrid-analysis
- Architecture-ssm-hybrid-rollout-plan
- Architecture-ssm-plugin-interface-design-review
- Architecture-transaction-coordinators
- Architecture-wiki-secondary-index
- Architecture-wire-protocol
- Governance-DISABLED-STUB-POLICY
- Governance-DOCS-PR-POLICY
- Governance-GA-PROMOTION-SIGN-OFF
- Governance-GITHUB-MILESTONES-SETUP
- Governance-MATURITY-CLAIM-VERIFICATION-CHECKLIST
- Governance-MATURITY-EVIDENCE-REGISTRY
- Governance-MERGE-GATE-BOT-CONFIG
- Governance-MERGE-GATE-STATUS-LIVE
- Governance-PHASE3-ENFORCEMENT-RUNBOOK
- Governance-PHASE-1-CLOSURE-REPORT
- Governance-PHASE-CLOSURE-POLICY
- Governance-PHASE-DEPENDENCY-GRAPH
- Governance-PLUGIN-SUBMODULE-ROLLBACK
- Governance-PRODUCTION-READY-2026-DELIVERY-PLAN
- Governance-PR-VERSION-TARGETING
- Governance-PR-VERSION-TARGETING-BACKFILL
- Governance-QUERY-MODULE-STATUS
- Governance-README
- Governance-RELEASE-PROMOTION-GATE-POLICY
- Governance-RELEASE-VALIDATION-CHECKLIST
- Governance-SECURITY-MODULE-5671-EVIDENCE-SUMMARY
- Governance-SHARDING-P6-RESIDUAL-RISK-ACCEPTANCE
- Governance-SOURCECODE-COMPLIANCE-GOVERNANCE
- Governance-UPDATES-DEVELOPMENT-STATUS-SIGN-OFF
- Governance-WAVE-C-IMPLEMENTATION-COMPLETE
- Module-acceleration-Roadmap
- Module-access-model-Roadmap
- Module-ai-Roadmap
- Module-analytics-Roadmap
- Module-api-Roadmap
- Module-aql-Roadmap
- Module-auth-Roadmap
- Module-base-Roadmap
- Module-cache-Roadmap
- Module-cdc-Roadmap
- Module-chaos-Roadmap
- Module-chimera-Roadmap
- Module-config-Roadmap
- Module-content-Roadmap
- Module-core-Roadmap
- Module-distributed-knowledge-Roadmap
- Module-distributed-tensor-Roadmap
- Module-document-Roadmap
- Module-ethics-ai-Roadmap
- Module-evaluation-Roadmap
- Module-execution-Roadmap
- Module-exporters-Roadmap
- Module-failover-Roadmap
- Module-geo-Roadmap
- Module-governance-Roadmap
- Module-gpu-Roadmap
- Module-graph-Roadmap
- Module-image-analysis-Roadmap
- Module-importers-Roadmap
- Module-index-Roadmap
- Module-ingestion-Roadmap
- Module-llama-cpp-Roadmap
- Module-llm-Roadmap
- Module-llm-streaming-Roadmap
- Module-llm-wiki-Roadmap
- Module-maintenance-Roadmap
- Module-metadata-Roadmap
- Module-network-Roadmap
- Module-observability-Roadmap
- Module-onnx-clip-Roadmap
- Module-performance-Roadmap
- Module-plugins-Roadmap
- Module-process-Roadmap
- Module-projects-Roadmap
- Module-prompt-engineering-Roadmap
- Module-query-Roadmap
- Module-rag-Roadmap
- Module-replication-Roadmap
- Module-retrieval-Roadmap
- Module-rpc-grpc-Roadmap
- Module-scheduler-Roadmap
- Module-scraper-Roadmap
- Module-search-Roadmap
- Module-security-Roadmap
- Module-server-Roadmap
- Module-sharding-Roadmap
- Module-stable-diffusion-Roadmap
- Module-storage-Roadmap
- Module-temporal-Roadmap
- Module-tensor-Roadmap
- Module-themis-Roadmap
- Module-timeseries-Roadmap
- Module-toolbox-Roadmap
- Module-training-Roadmap
- Module-transaction-Roadmap
- Module-updates-Roadmap
- Module-user-storage-encrypted-Roadmap
- Module-utils-Roadmap
- Module-vector-search-Roadmap
- Module-voice-Roadmap
- Module-whisper-Roadmap