Skip to content

Development Guide ​

This section covers building Kompile from source and contributing to its major libraries.

Prerequisites ​

  • Java 17
  • Maven 3.9+
  • 10 GB RAM minimum (16 GB+ recommended for native builds)
  • Docker (optional, for containerized builds)
  • GraalVM 21 (optional, for native image builds — 17 fails on these images; the CLI image needs ~8 GB, app-main runs with -J-Xmx80g)

Building from source ​

bash
# Full build
mvn clean install -DskipTests

# CLI only
cd kompile-cli && mvn clean package

# RAG application (kompile-app-main only, not the entire parent)
cd kompile-app/kompile-app-main && mvn clean package

# Native images / distribution archives (requires GraalVM 21)
# Backends (CPU/CUDA), DL4J snapshot bootstrap, memory needs, custom install
# dirs: see build-your-own-dist.md
./build-dist.sh cpu-intel

# Full distribution tarball
kompile build dist

Key dependencies ​

DependencyVersionPurpose
Java17Runtime
Spring Boot3.2.5Web framework
Spring AI1.0.0LLM abstraction
Picocli4.7.7CLI framework
ND4J1.0.0-SNAPSHOTBLAS compute
Lucenevia AnseriniText + vector search
JavaCPP1.5.13JNI bindings
GraalVM SDK24.0.1Native compilation
Jackson2.15.3JSON/YAML
Lombok1.18.42Boilerplate reduction

Repository structure ​

kompile/
  kompile-cli/                       CLI (Picocli)
  kompile-project-store/             Project manifest read/write
  kompile-app/                       Spring Boot RAG framework (40+ modules)
    kompile-app-core/                  Core interfaces
    kompile-app-main/                  Main application + Angular web UI
    kompile-model-manager/             Model download and cache
    kompile-model-staging/             Model lifecycle service
    kompile-embedding-*/               Embedding implementations
    kompile-vectorstore-*/             Vector store implementations
    kompile-loader-*/                  Document loaders
    kompile-source-*/                  Data sources
    kompile-chunker-*/                 Chunking strategies
    kompile-tool-*/                    Spring AI / MCP tools
    kompile-kvcache/                   Paged KV cache for local LLMs
    kompile-graph-neo4j/               Graph RAG with Neo4j
    kompile-ocr-*/                     OCR pipeline
  kompile-pipelines-framework/       Pipeline execution engine
  anserini/                          Lucene IR toolkit + SameDiff dense encoders
  tokenizers-rust/                   HuggingFace tokenizers -> JavaCPP JNI bindings
  kompile-model-importer-*/          Model importers (TensorFlow, ONNX, Keras)

Released under the Apache-2.0 License.