CLIENTS / JAVA SDK

Java SDK

The Java SDK loads prompt bundles packaged on the JVM classpath via a small, dependency-light API. It’s maintained in the promptLM/promptlm-clients repository under client-sdk-java/.

Requires JDK 17+.

Install

<dependency>
    <groupId>dev.promptlm</groupId>
    <artifactId>promptlm-client</artifactId>
    <version>0.1.0</version>
</dependency>

Gradle (Kotlin DSL):

dependencies {
    implementation("dev.promptlm:promptlm-client:0.1.0")
}

Usage

Drop a prompts/prompt-index.json (plus the prompt YAML files it references) anywhere on the classpath — typically under src/main/resources — and resolve a prompt by id:

import dev.promptlm.client.ClasspathPromptLoader;
import dev.promptlm.client.Prompt;
import dev.promptlm.client.PromptLoader;

PromptLoader loader = new ClasspathPromptLoader();
Prompt prompt = loader.loadPrompt("greeting.v1");
System.out.println(prompt.getName());
System.out.println(prompt.getPrompt());

The loader scans every classpath entry once on first use, builds an in-memory index, and rejects duplicate prompt ids across bundles.

Runtime bundles

The bundle format consumed by the SDK is produced by the bundle-release workflow described in Releases. It packages the store’s prompts as a Maven jar containing prompts/prompt-index.json and the referenced prompt files.