# haifengl/smile

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/haifengl-smile).**

6,387 stars · 1,149 forks · Java · NOASSERTION

## Links

- GitHub: https://github.com/haifengl/smile
- Homepage: https://haifengl.github.io
- awesome-repositories: https://awesome-repositories.com/repository/haifengl-smile.md

## Description

Smile is a comprehensive JVM machine learning library and statistical computing toolkit. It provides a suite of algorithms for classification, regression, and clustering, implemented natively for Java, Scala, and Kotlin. The project also functions as a deep learning framework, a natural language processing library, and an inference engine for large language models.

The library distinguishes itself through GPU acceleration via LibTorch bindings and support for the ONNX model interchange format. It includes specialized capabilities for large language model inference, featuring Byte-Pair Encoding tokenization and an OpenAI-compatible REST API with server-sent event streaming. Additionally, it allows trained models to be wrapped as transformers for integration into Apache Spark pipelines.

The toolkit covers a broad surface of data science capabilities, including linear algebra, numerical optimization, and statistical hypothesis testing. It provides tools for data preprocessing, dimensionality reduction, and signal processing, as well as interactive 2D and 3D visualization. For linguistic analysis, it supports part-of-speech tagging, stemming, and keyword extraction.

The project provides idiomatic JVM language APIs and includes a desktop environment with an interactive shell for exploratory data analysis and model training.

## Tags

### Artificial Intelligence & ML

- [JVM Machine Learning Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/jvm-machine-learning-libraries.md) — Provides a comprehensive suite of machine learning algorithms implemented natively for Java, Scala, and Kotlin.
- [GPU Acceleration](https://awesome-repositories.com/f/artificial-intelligence-ml/gpu-acceleration.md) — Accelerates neural network training and inference using native LibTorch bindings for GPU computation.
- [Inference Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-models/inference-engines.md) — Executes text generation and chat completions using BPE tokenization and streaming REST APIs. ([source](https://haifengl.github.io/))
- [Natural Language Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing.md) — Implements core linguistic analysis tasks including tokenization, stemming, part-of-speech tagging, and keyword extraction.
- [Natural Language Processing Libraries](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing-libraries.md) — Offers a full NLP library for tokenization, stemming, part-of-speech tagging, and keyword extraction.
- [Neural Network Training Toolkits](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-training-toolkits.md) — Develops deep learning models using GPU-accelerated tensors and standard neural network layer types. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Association Rule Learning](https://awesome-repositories.com/f/artificial-intelligence-ml/association-rule-learning.md) — Implements algorithms for discovering frequent itemsets and association rules within large datasets. ([source](https://haifengl.github.io/api/kotlin/index.html))
- [Spectral Clustering](https://awesome-repositories.com/f/artificial-intelligence-ml/clustering-algorithms/spectral-clustering.md) — Implements spectral clustering using the eigenvalues of a similarity matrix for dimensionality reduction and grouping. ([source](https://haifengl.github.io/api/clojure/index.html))
- [Dimensionality Reduction Techniques](https://awesome-repositories.com/f/artificial-intelligence-ml/dimensionality-reduction-techniques.md) — Provides algorithms for reducing the number of variables in a dataset while preserving essential structural information. ([source](https://haifengl.github.io/api/kotlin/index.html))
- [Genetic Algorithms](https://awesome-repositories.com/f/artificial-intelligence-ml/genetic-algorithms.md) — Applies genetic algorithms to evolve candidate solutions for complex optimization problems. ([source](https://haifengl.github.io/api/scala/index.html))
- [Keyword and Phrase Extraction](https://awesome-repositories.com/f/artificial-intelligence-ml/information-extraction/keyword-and-phrase-extraction.md) — Identifies significant terms and multi-word phrases from text using TF-IDF and BM25. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Clustering Algorithms](https://awesome-repositories.com/f/artificial-intelligence-ml/k-means-clustering/clustering-algorithms.md) — Groups similar data points into clusters based on shared characteristics using various unsupervised algorithms. ([source](https://haifengl.github.io/api/clojure/index.html))
- [Kernel Methods](https://awesome-repositories.com/f/artificial-intelligence-ml/kernel-methods.md) — Implements kernel functions for mapping data into higher-dimensional spaces, specifically for support vector machines. ([source](https://haifengl.github.io/api/java/index.html))
- [Large Language Model Serving](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-model-serving.md) — Runs text generation and chat completions using BPE tokenization and an OpenAI-compatible REST API.
- [Linear Regression](https://awesome-repositories.com/f/artificial-intelligence-ml/linear-regression.md) — Implements statistical methods for modeling relationships between variables using linear equations. ([source](https://haifengl.github.io/api/clojure/index.html))
- [Machine Learning Classification](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning-classification.md) — Trains models to categorize data into predefined classes using a variety of supervised classification algorithms. ([source](https://haifengl.github.io/api/kotlin/index.html))
- [ONNX Model Exporters](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-deployment-and-serving/serialization-and-export-formats/onnx-model-exporters.md) — Supports exporting and importing machine learning models using the standardized ONNX format for cross-framework compatibility.
- [Tensor Memory Management](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-optimization-and-inference/hardware-and-acceleration/tensor-computing-libraries/tensor-memory-management.md) — Automatically allocates and reclaims GPU tensor memory to prevent leaks during deep learning computation. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Byte Pair Encodings](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/language-tools/tokenization-algorithms/byte-pair-encodings.md) — Implements Byte-Pair Encoding for subword tokenization, ensuring compatibility with large language model vocabularies.
- [Manifold Learning Algorithms](https://awesome-repositories.com/f/artificial-intelligence-ml/manifold-learning-algorithms.md) — Implements algorithms that model the underlying manifold of high-dimensional data to identify topological structures. ([source](https://haifengl.github.io/api/java/index.html))
- [Hyperparameter Optimization](https://awesome-repositories.com/f/artificial-intelligence-ml/model-optimization/training-efficiency/hyperparameter-optimization.md) — Uses genetic algorithms to automate the search and selection of optimal configuration parameters for models. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Model Performance Evaluators](https://awesome-repositories.com/f/artificial-intelligence-ml/model-performance-evaluators.md) — Quantifies model accuracy and reliability using metrics like AUC and RMSE via cross-validation. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Model Serialization](https://awesome-repositories.com/f/artificial-intelligence-ml/model-serialization.md) — Saves trained machine learning models to disk for deployment and pipeline integration. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [OpenAI-Compatible Model Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-serving-apis/openai-compatible-model-servers.md) — Hosts trained models via an OpenAI-compatible REST API with server-sent event streaming.
- [Word Stemming](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing/word-stemming.md) — Reduces words to their root forms using standard stemming and lemmatization algorithms. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Non-Linear Regression](https://awesome-repositories.com/f/artificial-intelligence-ml/non-linear-regression.md) — Trains decision trees or neural networks to model complex non-linear relationships for continuous prediction. ([source](https://haifengl.github.io/api/clojure/index.html))
- [Part-of-Speech Taggers](https://awesome-repositories.com/f/artificial-intelligence-ml/part-of-speech-taggers.md) — Assigns grammatical tags to words in sentences using Hidden Markov Model taggers. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Sequence Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/sequence-learning-models/sequence-model-training.md) — Fits Hidden Markov Models or Conditional Random Fields to sequential data for tagging tasks. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Sequential Learning](https://awesome-repositories.com/f/artificial-intelligence-ml/sequential-learning.md) — Provides methods for training models on ordered data sequences, including HMMs and CRFs for sequence labeling. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Byte-Level Encoders](https://awesome-repositories.com/f/artificial-intelligence-ml/text-tokenizers/byte-level-encoders.md) — Encodes text into tokens using byte-level Byte-Pair Encoding for language model pipelines. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Time Series Forecasting](https://awesome-repositories.com/f/artificial-intelligence-ml/time-series-forecasting.md) — Implements models and architectures for predicting future values in temporal data sequences via autocorrelation analysis. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))

### Part of an Awesome List

- [Deep Learning Acceleration](https://awesome-repositories.com/f/awesome-lists/devtools/gpu-acceleration/deep-learning-acceleration.md) — Utilizes LibTorch bindings to accelerate tensor operations and neural network training on GPUs.
- [Machine Learning](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning.md) — Statistical Machine Intelligence & Learning Engine.
- [Machine Learning Libraries](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning-libraries.md) — Comprehensive set of pure Java libraries for statistical machine learning.
- [Science and Data Analysis](https://awesome-repositories.com/f/awesome-lists/ai/science-and-data-analysis.md) — Statistical machine intelligence and learning engine.

### Scientific & Mathematical Computing

- [Linear Algebra](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/linear-algebra.md) — Provides high-performance mathematical routines for vector and matrix operations via BLAS and LAPACK interfaces. ([source](https://haifengl.github.io/api/java/index.html))
- [Numerical Computing](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/mathematical-libraries-and-utilities/mathematics/numerical-computing.md) — Provides a mathematical toolkit for linear algebra, numerical optimization, and statistical computing on the JVM.
- [Statistical Analysis Libraries](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/statistics-probability/statistical-analysis-libraries.md) — Provides a toolkit for statistical analysis, hypothesis testing, and probability distributions on the JVM.
- [Distance Metrics](https://awesome-repositories.com/f/scientific-mathematical-computing/distance-metrics.md) — Implements algorithms for calculating distances between elements, including Euclidean, Mahalanobis, Hamming, and edit distances. ([source](https://haifengl.github.io/api/java/index.html))
- [Nearest Neighbor Searches](https://awesome-repositories.com/f/scientific-mathematical-computing/nearest-neighbor-searches.md) — Provides efficient algorithms for finding the closest points in multi-dimensional datasets using spatial structures like k-d trees. ([source](https://haifengl.github.io/api/scala/index.html))
- [Numerical Function Optimization](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-function-optimization.md) — Provides numerical function optimization using BFGS and L-BFGS algorithms. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Probability Distributions](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/statistics-probability/probability-distributions.md) — Implements various probability distributions such as Normal, Poisson, and Beta for statistical analysis. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Numerical Problem Solving](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-problem-solving.md) — Provides random number generators and unconstrained optimization for mathematical functions. ([source](https://haifengl.github.io/api/java/index.html))
- [Hypothesis Testing](https://awesome-repositories.com/f/scientific-mathematical-computing/research-analysis-workflows/research-and-data-analysis-tools/statistical-analysis-libraries/hypothesis-testing.md) — Conducts statistical hypothesis tests including t-tests, chi-squared, and ANOVA to validate assumptions. ([source](https://haifengl.github.io/))

### Software Engineering & Architecture

- [Native-Free Implementations](https://awesome-repositories.com/f/software-engineering-architecture/native-free-implementations.md) — Implements statistical and machine learning logic directly in Java and Scala to eliminate external native dependencies.

### Data & Databases

- [Text Preprocessing](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-transformation/text-nlp-preprocessing/text-preprocessing.md) — Extracts meaning from text through sentence splitting, tokenization, stemming, and tagging. ([source](https://haifengl.github.io/api/java/index.html))
- [Swing-Based Renderers](https://awesome-repositories.com/f/data-databases/interactive-visualization-rendering/swing-based-renderers.md) — Renders interactive 2D and 3D plots using the Java Swing framework for desktop data exploration.

### Development Tools & Productivity

- [Interactive Data Science Environments](https://awesome-repositories.com/f/development-tools-productivity/interactive-data-science-environments.md) — Offers a desktop environment with an interactive shell for exploratory data analysis and model training. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Interactive REPLs](https://awesome-repositories.com/f/development-tools-productivity/interactive-repls.md) — Provides an interactive Java and Scala REPL with pre-imported packages for rapid experimentation. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))

### DevOps & Infrastructure

- [LLaMA Model Support](https://awesome-repositories.com/f/devops-infrastructure/model-serving/llama-cpp-backend-runners/llama-runners/llama-model-support.md) — Generates text responses from LLaMA-3 models with support for chat and streaming API serving. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))

### Graphics & Multimedia

- [Interactive Scientific Plot Constructors](https://awesome-repositories.com/f/graphics-multimedia/data-plotting-workflows/2d-plot-constructors/interactive-scientific-plot-constructors.md) — Generates interactive 2D and 3D scatter plots and histograms for scientific data exploration. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))

### Programming Languages & Runtimes

- [Idiomatic API Wrappers](https://awesome-repositories.com/f/programming-languages-runtimes/idiomatic-api-wrappers.md) — Provides concise, idiomatic Scala, Kotlin, and Java wrappers for accessing machine learning algorithms. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))
- [Random Number Generation](https://awesome-repositories.com/f/programming-languages-runtimes/random-number-generation.md) — Provides high-quality pseudorandom number generation as an alternative to standard library generators. ([source](https://cdn.jsdelivr.net/gh/haifengl/smile@main/README.md))

### User Interface & Experience

- [Data Plotting Components](https://awesome-repositories.com/f/user-interface-experience/swing-based-ui-frameworks/data-plotting-components.md) — Renders interactive 2D and 3D statistical plots using the Java Swing framework.

### Web Development

- [Deep Learning Frameworks](https://awesome-repositories.com/f/web-development/state-management-models/state-space-models/deep-learning-frameworks.md) — Functions as a deep learning framework featuring GPU acceleration via LibTorch and ONNX model interchange support.
