jllm

mcp
Security Audit
Fail
Health Warn
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Fail
  • eval() — Dynamic code execution via eval() in core/jllm-eval/docker/llm.sh
  • network request — Outbound network request in jllm-web/src/main/resources/static/api.js
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

JLLM — A Native Agent Harness for Java Apps That Aren't Already Spring + LangChain4j

README.md

JLLM: a governed agent runtime for Java

Embed a tool-using AI agent in your Java application. Your code, your MCP servers and your REST APIs become its
tools, under permissions, approvals and isolation that you control.

One library, Java 21, no application framework in the core. The agent loop runs inside your process; your application
decides what the agent may touch and what needs a human.

Not related to other projects named jllm (for example beehive-lab/jllm or cmc-labo/jllm, which are inference
engines). JLLM talks to any OpenAI-compatible endpoint, so those can serve as its model backend.

AgentHarness h = new AgentHarnessBuilder()
    .modelClient(ModelClients.anthropic(AnthropicSettings.defaults(System.getenv("ANTHROPIC_API_KEY")), mapper))
    .tools(List.of(myTool))                      // your Java code as tools
    .settings(Path.of("harness.json"))           // MCP servers and REST APIs
    .approvalPolicy(ToolApprovalPolicy.byKind()) // who may do what without asking
    .systemPrompt("You work on the billing system. Never refund over 100 EUR without asking.")
    .build();

String chatId = h.sessions().create(null).chatId();
h.subscribe(chatId, 0, ev -> push(ev));          // text, tool_call, approval_request, ...
h.start(chatId, "Why was invoice 4711 charged twice?");

See it

Flow editor in jllm-web: plan, implement, review, gate, test, rework
Deterministic flows
A process as a graph of steps; the engine walks the path, the model works inside each step (flows)
Web chat with tool calls and a confirmation for web_download
Governed tool calls
Every call is visible; calls acting on untrusted content ask first
Approval dialog for web access to en.wikipedia.org
Human approval
Example: the agent asks before contacting a new host
Role editor: allow, ask or deny per tool pattern
Roles and tool permissions
Allow, ask or deny per tool pattern
jllm-cli session with tool calls and inline approvals
Same runtime in the terminal
Untrusted tool output tagged, approvals inline (jllm-cli)

Why enterprises pick it

Framework-free core Jackson, the JDK HttpClient, jsoup, json-schema-validator, swagger-parser (with its transitive libraries) and slf4j-api (full list: mvn dependency:tree -pl core/jllm-harness). No Spring, JPA or Micrometer in the library. Fits Spring Boot, Quarkus, Jakarta EE or plain Java (Spring recipes)
Governed tool calls tool kinds, permission modes, regex deny rules, hidden tools, per-host network approval, hooks to deny, rewrite or audit (security model)
Isolation path jail for file tools, Docker sandbox per command or per chat (also remote), and a JavaScript sandbox with no host access (JS)
Deterministic flows business processes as JSON maps of steps: your engine decides the path, the model does bounded work inside a step (flows)
Your infrastructure ports for chat stores, tokens, metrics, approvals and sandbox; OIDC sign-in and roles in the reference web app (identity, governance)
Open license Apache-2.0, small dependency footprint (compliance)

Model support: Anthropic and any OpenAI-compatible endpoint (OpenAI, Qwen, Grok, Gemini, llama.cpp, vLLM, Ollama),
with fallback chains and an optional fast model for summaries and classification.

Three ways to give the agent tools

Source You write
Your Java code a HarnessTool or SimpleTool with a lambda
MCP servers a mcpServers entry: URL or command, headers, allow and deny lists
REST APIs a restApis entry: OpenAPI URL, allowed and denied paths, OAuth per user

Built-in tools (files in a path jail, shell, web, sub-agents, skills) are also there and can be switched on and off.
See MCP and REST and TOOLS.

Where it fits

JLLM is an agent runtime, not a RAG toolkit or a model SDK. Use it beside Spring AI or LangChain4j when the agent must
act under approval and isolation. Comparison: JVM landscape,
terminal agents (sources), Why JLLM.

Modules

Module What Doc
jllm-harness the library README
jllm-cli terminal front end, one shaded jar README
jllm-web-commons framework-free handlers of the web API (chat, files, sign-in, users) README
jllm-web-spring-starter REST + SSE web API as a Spring Boot starter README
jllm-sql, jllm-sql-spring-starter SQL stores (SQLite, MySQL, PostgreSQL; plain JDBC) and their auto-configuration README
jllm-web reference web app: OIDC and password sign-in, roles, Vue chat UI, flow editor README
jllm-workflows, jllm-workflow-web optional flow engine and its web endpoints WORKFLOW
jllm-js, jllm-pdf, jllm-docs optional plugins: JavaScript sandbox, document readers JS, TOOLS

Quick start

mvn -pl jllm-cli -am package
java -jar jllm-cli/target/jllm-cli-1.3.0-jllm.jar --provider anthropic --mode edit      # terminal

mvn -pl jllm-web -am package
java -jar jllm-web/target/jllm-web-1.3.0-jllm.jar --provider anthropic                 # http://localhost:8080

Set ANTHROPIC_API_KEY (or OPENAI_API_KEY, GROK_API_KEY, QWEN_API_KEY) first.

The jars do not contain GraalJS, so run_js is off in the commands above. For development, run once scripts/setup
(.sh, .ps1, .cmd): it downloads the GraalJS set into the git-ignored .downloaded-libs/graal/<graalvm.version>/ (commercial
edition after you accept the Oracle GraalVM Free Terms and Conditions, or --accept-license; --edition community
for the community one) and runs the first build (--no-build skips it). Every module then sees GraalJS as a provided
dependency, with no profile and no flag. These run the built jars or the eval module on it (.sh, .ps1 and .cmd of each):

scripts/run-cli.sh --provider anthropic --mode edit       # terminal, with run_js
scripts/run-web.sh --jllm.provider=anthropic              # http://localhost:8080, with run_js
scripts/run-eval.sh                                       # eval module (needs a model; you run it, not the build)
mvn test                                                  # js plugin tests run on the same set

The release zip ships no GraalJS: setup.sh / setup.ps1, released next to it, unzip it and download the edition you choose into lib-ext/. Licensing and details: JS guide.

The GraalJS libraries are not in this repository. If they are present in .downloaded-libs/graal/, you downloaded them with
scripts/setup and accepted the license terms of the chosen edition. After a graalvm.version change, run
scripts/setup again.

SQL store

jllm-web keeps users, roles, chats, tokens and settings in SQL by default: SQLite in <jllm.webauth-dir>/jllm.db
(bundled, nothing to install), or MySQL / PostgreSQL (both experimental) chosen by the JDBC url alone:
jllm.sql.url=jdbc:postgresql://host:5432/jllm, jllm.sql.user, jllm.sql.password=${JLLM_SQL_PASSWORD}. jllm.store=file
keeps the files under webauth/ instead. The MySQL (GPL) and PostgreSQL drivers are never shipped: run
scripts/fetch-sql-driver.sh mysql|postgres (.ps1 / .cmd on Windows; in a release zip the script next to it) or
scripts/setup --sql; the jar is SHA-256 checked. Stored OAuth tokens are encrypted when JLLM_TOKEN_KEY is set.
Details: jllm-sql-spring-starter.

Maven Central

All modules are available on Maven Central under the group org.kendar.llm.

Tests and coverage

mvn test (or any later phase) runs the tests with JaCoCo and writes the aggregated report to
docs/coverage (Markdown index, committed); the HTML report goes to docs/coverage/html/ and is git-ignored.

Evaluation

jllm-eval runs the harness features against real models, graded by checks and an LLM
judge. Every run is recorded in the eval history: one row per run
(model, judge, pass rate, pass^k, tokens per trial, comparison with the baseline) linking to the run's recap.

Documentation

For Start here
Evaluating Why JLLM, security model, compliance, limits, securing a deployment
Integrating Embed in Java, Spring Boot, Extending
Operating Deployment, identity, observability, governance
Everything Docs index, long overview

Known limits and what is next

Today: single OIDC provider and no IdP role mapping; one global API key per model provider; the web app is a
reference front end to run behind your proxy; no Spring Boot starter for the harness itself (only the web API starter jllm-web-spring-starter; harness beans are recipes); no external security audit.

Stores (chat history, users, roles, tokens): memory or files in the library and the CLI; jllm-web uses SQL when jllm-sql-spring-starter is present, else files. To use your own storage, implement the store
interfaces and register them as beans or on the builder (ports).

Next: IdP role mapping (token claims to roles) and per-user model credentials (own API key or OAuth login per
provider, in development). Details: roadmap and limits.

Credits

License

Apache License 2.0. Redistributions and derivative works must keep the copyright notice and the
NOTICE file.

Reviews (0)

No results found