Smile
Statistical Machine Intelligence & Learning Engine
Last verified:
What is Smile?
SMILE (Statistical Machine Intelligence and Learning Engine) is a comprehensive, high-performance machine learning engine for the JVM. It supports Java, Scala, Kotlin, Clojure, and Groovy, offering hundreds of algorithms behind a clean, consistent API. From classic machine learning algorithms like classification, regression, and clustering to GPU-accelerated deep learning and native LLM inference, SMILE delivers state-of-the-art performance often outperforming R, Python, Spark, H2O, and XGBoost by several times while using far less memory.
Key features include comprehensive machine learning coverage (classification, regression, clustering, association rule mining, feature selection, manifold learning, nearest-neighbor search), natural language processing (sentence splitting, tokenization, stemming, POS tagging, keyword extraction, Word2Vec, LLM inference), deep learning with GPU acceleration via LibTorch, computer vision with pretrained EfficientNet-V2 models, linear algebra and statistics (dense/sparse matrices, decompositions, hypothesis tests), interactive visualization (2D/3D Swing plots and Vega-Lite), and an OpenAI-compatible REST server for LLM deployment. SMILE also provides SMILE Studio, a desktop IDE with multi-language notebook support and AI-powered agents.
SMILE is designed for data scientists and engineers working in the Java and Scala ecosystems who need a JVM-native alternative to Python-based libraries like scikit-learn. It is particularly suited for production environments where Java/Scala is the primary language, enterprise applications requiring embedded ML, teams wanting to avoid Python bridges for LLM inference, and developers who need fast training on a laptop without buying a cluster. LinkedIn used SMILE to train its workforce on machine learning for its AI Academy.
Smile pricing
Pricing model: Freemium
SMILE is completely free and open source under the LGPL-2.1+ license. All core modules (smile-core), deep learning (smile-deep), NLP (smile-nlp), and visualization (smile-plot) are published to Maven Central at no cost. There are no paid tiers, subscription plans, or enterprise licensing fees. The SMILE Studio desktop IDE and interactive shell are included free in the self-contained release package.
Smile pros
- Outperforms R, Python, Spark, H2O, and XGBoost significantly in speed
- Uses far less memory than competing frameworks
- Pure Java/Scala/Kotlin implementation with no Python bridge required
- Native LLM inference on JVM with LibTorch backend
- GPU-accelerated deep learning via LibTorch
- Pretrained EfficientNet-V2 models for ImageNet classification
- Hundreds of algorithms behind clean, consistent API
- Scala and Kotlin bindings with high-level DSL operators
- OpenAI-compatible REST server with SSE streaming for production
- Comprehensive NLP including sentence splitter, stemmers, POS tagger, Word2Vec
- Interactive 2D/3D Swing plots and declarative Vega-Lite charts
- Complete linear algebra with LU, Cholesky, QR, EVD, SVD decompositions
- Built-in CLI for training, prediction, and HTTP inference server
- SMILE Studio desktop IDE with multi-language notebook support
- Open source with LGPL-2.1+ friendly license
- Supports Parquet, Avro, Arrow, CSV, ARFF, LibSVM, JSON data formats
- Out-of-bag accuracy estimation for Random Forest without validation set
- Scala-based computer algebra system with symbolic differentiation
Smile cons
- Requires Java 25 (v6), increasing minimum Java version requirement
- Deep learning and LLMs require LibTorch native libraries setup
- GPU support needs matching CUDA version for Bytedeco pytorch classifier
- Keyword extraction algorithm requires long articles, won't work on short text like tweets
- SMILE Studio requires graphical environment, not headless-compatible
- SMILE Studio needs at least 4 GB RAM (8 GB recommended for large datasets)
- Native BLAS/LAPACK installation required separately for optimal performance on some algorithms
- Bernoulli naive Bayes requires feature selection or accuracy will be low
Frequently asked questions about Smile
What programming languages does SMILE support?
SMILE is a JVM-native library with core implementation in Java. It provides idiomatic APIs for Java, Scala, Kotlin, Clojure, and Groovy. The Scala and Kotlin bindings add high-level operators and DSL builders for more concise code. All languages access the same underlying algorithms through language-specific APIs.
What is the minimum Java version required for SMILE?
SMILE v6 requires Java 25. This is a significant requirement as it uses the latest Java features. The SMILE Studio desktop IDE also requires Java 25 and a graphical (non-headless) environment.
How does SMILE's performance compare to other ML libraries?
According to third-party benchmarks, SMILE outperforms R, Python, Spark, H2O, and XGBoost significantly—often by several times while using far less memory. The library uses advanced data structures and algorithms to deliver state-of-the-art performance, enabling training of advanced models on a laptop without needing a cluster.
Can SMILE run large language models natively?
Yes, SMILE ships a complete LLM stack backed by LibTorch with tiktoken BPE tokenizer, grouped-query attention (GQA), rotary positional encoding (RoPE), SwiGLU feed-forward, and KV-cache. It supports LLaMA-3 inference natively on the JVM without any Python bridge, and includes an OpenAI-compatible REST server with Server-Sent Events (SSE) streaming for production deployment.
What deep learning capabilities does SMILE offer?
The smile-deep module exposes LibTorch tensors, all standard layer types (linear, Conv2d, pooling, BN/GN/RMS norm, dropout, embedding), loss functions, and optimizers (SGD, Adam, AdamW, RMSprop) through a clean Java API. It includes pretrained EfficientNet-V2 (S/M/L) models for ImageNet classification available with a single method call, and supports GPU acceleration when LibTorch native libraries are properly configured.
What NLP tasks does SMILE support?
The smile-nlp module focuses on low and intermediate level NLP tasks including sentence breaking, word tokenization, Porter/Lancaster stemming, HMM POS tagging, bigram/phrase extraction, keyword detection using word co-occurrence, BM25 relevance ranking, and Word2Vec embeddings. It also includes text normalization for Unicode handling and stop word filtering with multiple built-in lists.
How do I install SMILE in my project?
Add the relevant artifacts to your build tool from Maven Central. For Maven, include smile-core for core ML algorithms, smile-deep for deep learning and LLMs, smile-nlp for natural language processing, and smile-plot for visualization. For Gradle, use implementation dependencies with the same group ID com.github.haifengl. All artifacts are versioned at 6.1.0.
Does SMILE provide an interactive development environment?
Yes, SMILE provides multiple options: an interactive JShell-based shell with all classes pre-imported, Scala and Kotlin REPLs, and SMILE Studio—a desktop IDE combining a multi-language notebook (supporting Java, Scala, Python kernels), AI-powered agent panel with three built-in agents (Clair the Analyst, James the Java Guru, Guido the Pythonista), file explorer, and kernel explorer for runtime variables.
Can I deploy SMILE models as a service?
Yes, SMILE provides a command-line interface for starting an HTTP inference server powered by Quarkus. Use './smile serve --model <model-file>' to start a server listening on port 8080. It supports querying single samples via POST requests and streaming large payloads element-by-element through the /stream endpoint with full back-pressure, safely handling multi-GB requests.
What data formats does SMILE support for loading data?
SMILE supports many data formats including Parquet, Avro, Arrow, CSV, ARFF (Weka format), LibSVM, and JSON. All parsers return a DataFrame for consistent processing. The Read API provides methods like Read.arff(), Read.csv() with configurable delimiters and header options for different file formats.