Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

Jlama

> 数据库
Open source

Jlama is a modern LLM inference engine for Java

1.3K stars0 likes2 views
WebsiteGitHub

About

Jlama is a modern LLM inference engine for Java

Jlama: A modern LLM inference engine for Java

Features

Model Support:

  • Gemma & Gemma 2 Models
  • Llama & Llama2 & Llama3 Models
  • Mistral & Mixtral Models
  • Qwen2 Models
  • IBM Granite Models
  • GPT-2 Models
  • BERT Models
  • BPE Tokenizers
  • WordPiece Tokenizers

Implements:

  • Paged Attention
  • Mixture of Experts
  • Tool Calling
  • Generate Embeddings
  • Classifier Support
  • Huggingface SafeTensors model and tokenizer format
  • Support for F32, F16, BF16 types
  • Support for Q8, Q4 model quantization
  • Fast GEMM operations
  • Distributed Inference!

Jlama requires Java 20 or later and it built with the following backends:

  • Panama Vector (default)
  • Native SIMD (optional)
  • WebGPU (optional, experimental)

What is it used for?

Add LLM Inference directly to your Java application. To learn more read the DeepWiki docs.

Quick Start

️‍♀️ How to use as a local client (with jbang!)

Jlama includes a command line tool that makes it easy to use.

The CLI can be run with jbang.

bash
#Install jbang (or https://www.jbang.dev/download/)
curl -Ls https://sh.jbang.dev | bash -s - app setup

#Install Jlama CLI (will ask if you trust the source)
jbang app install --force jlama@tjake

Now that you have jlama installed you can download a model from huggingface and chat with it. Note I have pre-quantized models available at https://hf.co/tjake

bash
# Run the openai chat api and UI on a model
jlama restapi tjake/Llama-3.2-1B-Instruct-JQ4 --auto-download

open browser to http://localhost:8080/

…

‍ How to use in your Java project

The main purpose of Jlama is to provide a simple way to use large language models in Java.

The simplest way to embed Jlama in your app is with the Langchain4j Integration.

If you would like to embed Jlama without langchain4j, add the following maven dependencies to your project:

xml

  com.github.tjake
  jlama-core
  ${jlama.version}

  com.github.tjake
  jlama-native
  
  ${os.detected.name}-${os.detected.arch}
  ${jlama.version}

jlama uses Java 21 preview features. You can enable the features globally with:

bash
export JDK_JAVA_OPTIONS="--add-modules jdk.incubator.vector --enable-preview"

or enable the preview features by configuring maven compiler and failsafe plugins.

Then you can use the Model classes to run models:

…

Or you can use a Builder API:

…

You can simplify promptSupport using:

…

Devloping Jlama

See DEVELOPER_GUIDE.md for more information.

⭐ Give us a Star!

If you like or are using this project to build your own, please give us a star. It's a free way to show your support.

️ Roadmap

  • Support more and more models
  • Add pure java tokenizers
  • Support Quantization (e.g. k-quantization)
  • Add LoRA support
  • GraalVM support
  • Add distributed inference

️ License and Citation

The code is available under Apache License.

If you find this project helpful in your research, please cite this work at

@misc{jlama2024,
    title = {Jlama: A modern Java inference engine for large language models},
    url = {https://github.com/tjake/jlama},
    author = {T Jake Luciani},
    month = {January},
    year = {2024}
}

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaaigenaigpthuggingface

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库