FAQ

Which Java version do I need?

SMILE v5, v6, and v7 require Java 25. SMILE v4.x requires Java 21. Stay on a 4.4.x release when the project is still on Java 21. SMILE v3.x runs on Java 8 / 11 / 17 (Java 8 for core ML modules; smile-deep and smile-plot require Java 17). See Quick Start for install and build steps.

Supported versions & lifecycle policy

We support security fixes for the latest stable release and selected Long-Term Support (LTS) versions for earlier Java baselines:

Version Java Baseline Security Updates Status / Notes
7.x Java 25 Supported (✅) Current active release line
6.x Java 25 End-of-Life (❌) End-of-Life (EoL) — superseded by 7.x
5.x Java 25 End-of-Life (❌) End-of-Life (EoL) — superseded by 7.x
4.4.x Java 21 Supported (✅) Supported for Java 21 LTS environments
< 4.4 Java 21 End-of-Life (❌) End-of-Life (EoL) — upgrade to 4.4.x
3.1.x Java 8 / 17 Supported (✅) Supported for Java 8 / 11 / 17 LTS environments
< 3.1 Java 8 End-of-Life (❌) End-of-Life (EoL) — upgrade to 3.1.x

End-of-Life (EoL) & Commercial Support Notice: With the release of SMILE 7.x, the 5.x and 6.x release lines have reached End-of-Life (EoL) and no longer receive public security patches or maintenance updates. Organizations requiring guaranteed 24-hour Critical/High CVE resolution SLAs, security backports, or commercial IP indemnification across supported or legacy versions can obtain a commercial license or OEM maintenance subscription at Commercial Licensing or by contacting sales@aihalo.dev.

Artifacts are published to Maven Central. Start with smile-core; add other modules as needed (smile-deep, smile-nlp, smile-plot, smile-kotlin, smile-scala).


<dependency>
  <groupId>com.github.haifengl</groupId>
  <artifactId>smile-core</artifactId>
  <version>7.1.0</version>
</dependency>

<!-- Deep learning + LLMs (requires LibTorch; see FAQ below) -->
<dependency>
  <groupId>com.github.haifengl</groupId>
  <artifactId>smile-deep</artifactId>
  <version>7.1.0</version>
</dependency>

<dependency>
  <groupId>com.github.haifengl</groupId>
  <artifactId>smile-nlp</artifactId>
  <version>7.1.0</version>
</dependency>

<dependency>
  <groupId>com.github.haifengl</groupId>
  <artifactId>smile-plot</artifactId>
  <version>7.1.0</version>
</dependency>
            

smile.tensor includes a pure-Java BLAS and LAPACK fallback, so all algorithms work out of the box without native libraries installed. For large-scale linear algebra (manifold learning, Gaussian Process, MLP, …), SMILE automatically dispatches to native BLAS/LAPACK through Java FFM when available. You can install system libraries such as OpenBLAS and ARPACK (Linux packages, Homebrew arpack, or the release package bin/ on PATH for Windows), or select the backend explicitly via -Dsmile.linalg.backend=auto|native|java (or the SMILE_LINALG_BACKEND environment variable). Details are in Quick Start.

To pick a specific BLAS shared library name, set -Dsmile.lib.blas=... (for example mkl_rt for Intel MKL, or blas for Accelerate on macOS). Deep learning native loading is separate — see LibTorch / FFM below.

Building from source

The multi-module build uses Gradle (Java 25 required):

Bash

./gradlew build -x test
    

SBT remains available for some Scala packaging workflows, but the documented path for contributors is Gradle. See Build from Source.

What is Agent Studio?

Agent Studio is a coding agent on your machine, an AutoML workplace that builds the models for Serve Engine, and an operating system for startups. A notebook, an agent panel, and the project sit in one window. Java, Kotlin, Scala, and Python notebooks share one editor, and you can write the cells yourself. Nine agents cover the model, the code, the product, the design, growth, sales, coordination, and the desktop. Clair can take a data file through profiling, features, model selection, tuning, and evaluation. A fitted model leaves as a .sml file, or you can start a REST inference service for it from the kernel explorer.

It ships in the release package. Launch with ./smile after bin/setup. Free to evaluate. Annual seats cover production use. See Agent Studio for the product, and SMILE Studio for the manual.

What is Serve Engine?

Serve Engine is the inference runtime for classic machine learning, computer vision, and LLMs. Serialized SMILE models (.sml), ONNX graphs, and OpenAI-compatible chat run in the same process, on your machines and your network. A web UI for chat, SMILE, and ONNX is served from that process. Agent loops get a fast first token, a fast tool round trip, and a memory budget reserved when the model loads.

Commercial licensing removes the AGPL restriction for production use. See Serve Engine for the product, and SMILE Serve for the manual.

LibTorch, GPU, and java.library.path

smile-deep calls LibTorch through Java’s Foreign Function & Memory (FFM) API — not JNI. Native libraries are resolved by the platform loader (LD_LIBRARY_PATH on Linux, PATH on Windows), not java.library.path. On macOS, SIP often strips DYLD_LIBRARY_PATH; prefer copying or symlinking required .dylib files as described in Quick Start — GPU / LibTorch. The release package bundles libsmile_torch and LibTorch under bin/ and libtorch/.

Data format

Most algorithms take double[] / double[][] or a DataFrame. Read and write CSV, Parquet, Arrow, ARFF, JSON, LibSVM, and more with smile.io.Read / Write. See Data Processing and Data Import and Export.

Model serialization

To save and load a serializable model object:


import java.nio.file.Path;
import smile.io.Read;
import smile.io.Write;

Write.object(model, Path.of("model.sml"));
var loaded = Read.object(Path.of("model.sml"));
            

This uses Java serialization. For SMILE Serve, prefer a boxed smile.model.Model as shown in the Tutorial. ONNX export is covered in the core ONNX docs and Serve.

Headless plot

To generate plots without a display, enable AWT headless mode. With the release shell:

Bash

smile shell -R-Djava.awt.headless=true
    

Save a Swing figure to PNG without showing a window:


import java.nio.file.Path;
import javax.imageio.ImageIO;
import org.apache.commons.csv.CSVFormat;
import smile.io.Read;
import smile.plot.swing.ScatterPlot;

var format = CSVFormat.Builder.create().setDelimiter('\t').get();
var toy = Read.csv("data/classification/toy200.txt", format);
var figure = ScatterPlot.of(toy, "V2", "V3", "V1", '.').figure();
var image = figure.toBufferedImage(400, 400);
ImageIO.write(image, "png", Path.of("headless.png").toFile());
            

See Data Visualization. For declarative charts without Swing, use Vega-Lite.

How can I set the random number generator seed for random forest?

This is a common question for stochastic algorithms like random forest. In general, setting a seed is discouraged because people often choose a bad seed without enough knowledge of random number generation. For repeatable tests, call smile.math.MathEx.setSeed before training.

There is no per-algorithm setSeed(). Many algorithms are multithreaded and each thread has its own generator. Sharing one generator would require locks and hurt performance. Seeding every thread identically (for example in a random forest) would also destroy the intended randomness.

How should I cite SMILE?

Please cite SMILE in your publications if it helps your research. Here is an example BibTeX entry:

BibTeX

    @misc{Li2014SMILE,
      title={SMILE: Statistical Machine Intelligence and Learning Engine},
      author={Haifeng Li},
      year={2014},
      howpublished={\url{https://www.aihalo.dev/}},
    }