Statistical Machine Intelligence & Learning Engine SMILE (Statistical Machine Intelligence & Learning Engine) is a comprehensive, high-performance machine learning and AI platform for the JVM. Built on Java 25 with idiomatic APIs for Kotlin and Scala (v4.x supports Java 21; earlier versions support Java 8), SMILE covers the entire lifecycle of machine intelligence: building models with agentic AutoML, embedding…
SMILE (Statistical Machine Intelligence & Learning Engine) is a comprehensive,
high-performance machine learning and AI platform for the JVM. Built on Java 25
with idiomatic APIs for Kotlin and Scala (v4.x supports Java 21; earlier
versions support Java 8), SMILE covers the entire lifecycle of machine intelligence:
building models with agentic AutoML, embedding algorithms directly in your
application, and serving classical ML, ONNX graphs, and LLMs on your own machines.
Vision: Intelligence Where the Work Is
A decision should not require a cloud round-trip or a fragile bridge to an external
Python stack. The score, the explanation, and the model update belong on the machine
that already holds the facts: inside a JVM microservice, a branch server, a payment
terminal, a vehicle gateway, or an air-gapped node. SMILE makes real-time,
autonomous machine intelligence native to the systems enterprises already run, from
resource-constrained edge gateways to multi-GPU clusters.
What We Value
Sovereign & Self-Hosted by Default: Your data, models, API keys, and telemetry stay on your machines and your network. Everything is built to run locally and keep working when the external link is down.
Zero-Bloat Craftsmanship: The core engine is pure, self-contained JVM bytecode built on compact, cache-friendly data structures. You get deterministic low latency and a tiny memory footprint by default, with optional plug-and-play native acceleration (OpenBLAS/LAPACK, ONNX Runtime, LibTorch/CUDA) when hardware is available.
Explainable & Auditable in Place: High-stakes decisions cannot be black boxes. SMILE provides both exact TreeSHAP for tree ensembles and model-agnostic KernelSHAP for any classifier or regressor, computing local feature attributions in-process alongside predictions, while AutoML workflows generate readable Java, Scala, Kotlin, or Python notebooks you can inspect line by line.
Open Source with Enterprise Backing: Open-source licensing supports academic research and community collaboration, while commercial licensing from HALO.AI removes copyleft and source-disclosure obligations for proprietary, embedded, and mission-critical production deployments.
Key Strengths
Comprehensive Breadth in One Engine: Hundreds of algorithms spanning classification, regression, clustering, manifold learning, time series, anomaly detection, NLP, statistical testing, linear algebra, deep learning, computer vision, and native LLM inference (MiniMax M3, Qwen, Llama, tiktoken, Radix KV cache, MTP speculative decoding).
State-of-the-Art Speed & Footprint: Engineered with primitive-backed memory layouts, Panama FFM, and the Java Vector API (SIMD), SMILE routinely outperforms R, Python, Spark, and H2O while scaling down to a 0.2 GB GraalVM native micro-container that boots in 0.4 s and idles at ~80 MiB RAM.
On-Device Training & Adaptation: Unlike static inference-only runtimes, SMILE trains and updates models (Random Forests, Gradient Boosting, K-Means, DBSCAN, anomaly detectors) directly on live edge or application data.
Built for Agentic & Production Workloads: Continuous batching, prefix-preserving Radix KV caches, and speculative decoding that retains its speedup under full batch load, paired with atomic model hot-swapping, Kubernetes health probes, and Prometheus metrics.
Three Pillars of SMILE
1. Core Engine: Embed in Your Application
Call classification, regression, clustering, deep learning, NLP, and visualization directly in-process from Java, Scala, or Kotlin with no separate service to operate.
2. SMILE Serve: Unified Inference Runtime
A production-ready, Quarkus-based inference server (available as JVM, CUDA GPU, and GraalVM native containers) that brings together three complementary inference capabilities in a single process:
Capability
API prefix
Description
Classic ML
/api/v1/smile
Serialized SMILE models (.sml) — classification, regression, clustering (ClusteringModel), vector quantization (VectorQuantizerModel), and anomaly detection (AnomalyModel), with local SHAP explanations (TreeSHAP & KernelSHAP)
ONNX Runtime
/api/v1/onnx
Any model in the ONNX open format (.onnx)
LLM Chat
/api/v1/chat
OpenAI-compatible chat completions, tool calling, and SSE streaming
Models
/api/v1/models
OpenAI-compatible list and retrieve for every loaded model — chat, ONNX, and SMILE
Metrics
/q/metrics
Prometheus scrape for classic, ONNX, and LLM models
A React-based web UI is bundled and served from the same process.
See serve/README.md for how to build and run the service.
3. SMILE Agent Studio: AI Agent Workspace, Autonomous Bot Hub & Polyglot IDE
A local-first desktop workspace that unites a coordinated team of 9 specialized AI agents (spanning executive chief-of-staff, product management, developer evangelism, B2B sales, data science, software architecture, Java/Python engineering, and desktop GUI automation), the always-on Agent Hub (smile hub) for scheduled and event-driven background bots with human-in-the-loop approval queues, and a polyglot IDE with interactive notebooks (Java, Scala, Kotlin, and Python/Jupyter) and code/data explorers. Studio is fully extensible: drop custom agent specs (AGENT.md), skills, MCP servers, or plugins into your workspace to add domain-specific specialists and routines with zero code changes.
See studio/README.md and studio/BOT.md to get your workspace and bots running in minutes.
SmileTransformer, SmileClassifier, SmileRegressor; training and scoring in Spark DataFrames
Installation
Maven
<!-- Core ML algorithms --><dependency><groupId>com.github.haifengl</groupId><artifactId>smile-core</artifactId><version>7.1.0</version></dependency><!-- Deep learning + LLMs (requires LibTorch) --><dependency><groupId>com.github.haifengl</groupId><artifactId>smile-deep</artifactId><version>7.1.0</version></dependency><!-- Natural language processing --><dependency><groupId>com.github.haifengl</groupId><artifactId>smile-nlp</artifactId><version>7.1.0</version></dependency><!-- Data visualization --><dependency><groupId>com.github.haifengl</groupId><artifactId>smile-plot</artifactId><version>7.1.0</version></dependency>
Do not rely on DYLD_LIBRARY_PATH: macOS System Integrity Protection (SIP)
strips DYLD_* variables when the JVM is started through the /usr/bin/java
stub, so dyld never sees them. SMILE reaches libarpack through the FFM
bindings, whose SymbolLookup.libraryLookup("arpack") calls dlopen on the bare
name libarpack.dylib; this does not consult java.library.path, so
-Djava.library.path=... and LD_LIBRARY_PATH have no effect either. SMILE
therefore preloads the library by absolute path through
smile.linalg.NativeLibrary, which finds it under /opt/homebrew/lib or
/usr/local/lib with no copy or symlink. To point it somewhere else, set the
arpack.native.path system property or the ARPACK_NATIVE_PATH environment
variable.
Windows — pre-built DLLs are included in the bin/ directory of the
release package.
Add that directory to PATH.
GPU (CUDA) — make sure the LibTorch CUDA native libraries are on
PATH (Windows) or LD_LIBRARY_PATH (Linux).
Quick Start
import smile.classification.RandomForest;
import smile.data.formula.Formula;
import smile.io.Read;
// Load data
var data = Read.csv("src/test/resources/iris.csv");
// Train a random forest
var forest = RandomForest.fit(Formula.lhs("species"), data);
// Predict
int label = forest.predict(data.get(0));
System.out.println("Predicted class: " + label);
SMILE Agent Studio is the local-first AI agent workspace, 24/7 autonomous Bot Hub (smile hub), and polyglot IDE (Java, Scala, Kotlin, and Python/Jupyter). It pairs 9 built-in specialist agents (Frank Chief of Staff, Steve Product Manager, Julien Evangelist, Mike B2B Sales, Clair Data Scientist, Ada Architect, James Java Guru, Guido Pythonista, and Chuck Desktop Operator), human-in-the-loop batch draft queues, and zero-code extensibility for custom agents, skills, plugins, and bot routines with interactive notebooks and code/data editors.
See studio/README.md, studio/BOT.md, and studio/CLI.md for full documentation.
Download a pre-packaged release from the
releases page, then:
path/to/smile/bin/setup # install required native dependencies
path/to/smile/bin/smile # launch SMILE Agent Studio from your project directory
CLI entry points:
Command
Description
smile
Launch SMILE Agent Studio (desktop AI workspace, Bot Hub & polyglot IDE)
smile hub
Start the always-on Agent Hub & Bot runtime service (BOT.md)
smile shell
Java (JShell) REPL with all SMILE packages pre-imported
smile scala
Scala 3 REPL
smile train
Train a classification, regression, clustering, VQ, or anomaly model
smile predict
Run batch inference (with optional probabilities and SHAP explanations)
smile serve
Start the unified HTTP inference server (Classic ML, ONNX, and LLM chat)
To increase the JVM heap:
path/to/smile/bin/smile -J-Xmx30G
Model Serialization
Most SMILE models implement java.io.Serializable. You can serialize a
trained model to disk and load it in a production environment or inside a
Spark job:
// Save
try (var out = new ObjectOutputStream(new FileOutputStream("model.ser"))) {
out.writeObject(forest);
}
// Load
try (var in = new ObjectInputStream(new FileInputStream("model.ser"))) {
var loaded = (RandomForest) in.readObject();
}
Visualization
SMILE provides two visualization layers:
smile.plot.swing — Swing-based interactive 2D/3D plots. See plot/README.md.
smile.plot.vega — Declarative Vega-Lite charts for browsers and Jupyter. See plot/VEGA.md.
SMILE uses a multi-license model that keeps academic research and open-source collaboration free while providing standard, upfront commercial licenses—administered by HALO.AI LLC—for proprietary distribution and production deployments:
OEM & Embedded ($25,000 one-time) — Perpetual right to embed and ship in proprietary products free of GPLv3 disclosure, plus Year 1 Maintenance & 10 Agent Studio seats (optional 20% / $5,000 yr renewal)
SMILE Serve (serve)
AGPLv3 — Free when complying with §13 network source disclosure
Production Runtime ($12,000 / year) — Covers up to 4 production server nodes ($250/node/mo) + internal Core Engine + 5 free Agent Studio seats, with zero AGPLv3/GPLv3 disclosure
SMILE Agent Studio (studio)
BSL 1.1 — Free for personal, academic, and non-production evaluation (converts to AGPLv3 after 4 years)
Bundled Free with Runtime (5 seats), OEM (10 seats), and Enterprise (25 seats), or $95 / seat / mo ($995/seat/yr paid annually, 5-seat standalone min)
Enterprise & Edge Fleet
—
From $50,000 / year — Volume edge-node licensing (100–5,000+ gateways), site-wide OEM rights, 25 Studio seats, and optional $15k 30-day Turnkey Pilot
评论