Repolode
deepjavalibrary

deepjavalibrary/djl

An engine-agnostic deep learning framework for Java that lets developers build, train, and run models with a native Java API.

Stars
4,860
Forks
762
Open issues
236
Last commit
5 days ago

What is it?

Deep Java Library (DJL) is a high-level deep learning framework for Java. It wraps existing engines such as PyTorch, TensorFlow, MXNet, and ONNX Runtime behind one Java API, so developers can work with models without learning a separate Python stack.

DJL works like a regular Java library and fits into standard IDEs and build tools. It offers a model zoo for loading pre-trained models for tasks such as object detection, and provides built-in neural network blocks, datasets like MNIST, and training configuration APIs for training models directly in Java. It also selects CPU or GPU automatically based on the hardware configuration.

Because the engine is abstracted away, projects are not locked to one backend and can switch engines later. The project is aimed at Java developers who want to add machine learning inference or training to existing Java applications.

Key features

  • 01Engine-agnostic API that works with PyTorch, TensorFlow, MXNet, and ONNX Runtime.
  • 02Pre-trained model zoo for loading models by application and architecture.
  • 03Built-in neural network blocks and datasets for training in Java.
  • 04Automatic CPU/GPU selection based on hardware.
  • 05Standard Gradle-based build that works in common Java IDEs.

Use cases

  • Adding image classification or object detection to an existing Java backend service.
  • Running inference with pre-trained ONNX or PyTorch models inside a JVM application.
  • Training small neural networks in Java for teams that prefer not to use Python.
  • Learning deep learning concepts through a Java-native codebase.

Quick start

  1. 1

    Read the Getting Started guide in the docs

  2. 2

    Build the project from source on Linux or macOS

    ./gradlew build
  3. 3

    Build from source on Windows

    gradlew build

Things to know

  • Building from source requires a Gradle toolchain and a Java development environment.
  • Engine-specific native libraries may need extra setup depending on the backend you choose.

Topics

FAQ

What is djl?
An engine-agnostic deep learning framework for Java that lets developers build, train, and run models with a native Java API. Deep Java Library (DJL) is a high-level deep learning framework for Java. It wraps existing engines such as PyTorch, TensorFlow, MXNet, and ONNX Runtime behind one Java API, so developers can work with models without learning a separate Python stack.
Is djl free to use? What license does it have?
djl is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is djl still maintained?
Actively maintained. The last commit to djl was on Nov 2, 2026.
What can I use djl for?
Adding image classification or object detection to an existing Java backend service. Running inference with pre-trained ONNX or PyTorch models inside a JVM application. Training small neural networks in Java for teams that prefer not to use Python. Learning deep learning concepts through a Java-native codebase.
How do I install djl?
Read the Getting Started guide in the docs Build the project from source on Linux or macOS: ./gradlew build Build from source on Windows: gradlew build
Where can I get djl?
The source code and installation instructions are on GitHub: https://github.com/deepjavalibrary/djl

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects