AISL turns a prompt into a typed Java interface. Spring registers it as a bean, and you inject it and call it like any other. A skill isn’t instructions written as informal text: what goes to the model and what comes back is Java, checked by the compiler like the rest of your code. When the method returns a record, the model’s reply comes back as that record.

It runs on Spring AI, with local models through Ollama by default. Every prompt in Knoden PIM goes through it, and you can use it without PIM.

LGPL-3.0, so you can use it in any application, open or closed. Code: gitlab.com/knoden/aisl-core. Java 25, Spring Boot 4.1, Spring AI 2.0.

A prompt is an interface

public interface SummarizerSkill {

    @AislPrompt(system = "Summarize the text in exactly {length}: {text}")
    String summarize(@AislParam("text") String text, @AislParam("length") String length);
}
@SpringBootApplication
@EnableAislSkills
public class HelloApp {

    public static void main(String[] args) {
        SpringApplication.run(HelloApp.class, args);
    }

    @Bean
    CommandLineRunner run(SummarizerSkill summarizer) {
        return args -> System.out.println(
                summarizer.summarize("Spring AI connects Spring applications to AI models. "
                        + "Ollama runs those models on your own computer.", "one sentence"));
    }
}

@EnableAislSkills finds the interface and registers a bean for it. There’s no implementation to write. Each call fills the {placeholders} from the arguments and sends the prompt to the model through Spring AI.

What you get

  • Typed replies. Return a record instead of a String and the reply comes back as that record, through Spring AI’s structured output. Real Java types work too, such as DayOfWeek or LocalTime.
  • A model per skill. Name the default model with aisl.model in application.properties, and move one skill alone to another with aisl.skill-models.<bean name>. The rest of the application stays on the small, fast model.
  • .aisl files for larger sets. A short declarative format that a build-time compiler turns into the same kind of bean. An output_schema block also generates the Java records, and a skill can record its own model and whether a thinking model should think.

Get started

Install Ollama and pull the default model (ollama pull gemma4). The artifacts are in a public GitLab package registry, so there’s no token to set up, but they aren’t on Maven Central yet, so Gradle needs to be told where they are:

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        exclusiveContent {
            forRepository {
                maven { url = uri("https://gitlab.com/api/v4/projects/86960067/packages/maven") }
            }
            filter { includeGroup("com.knoden.aisl") }
        }
        mavenCentral()
    }
}
// build.gradle.kts
plugins {
    java
    id("org.springframework.boot") version "4.1.1"
}

java { toolchain { languageVersion.set(JavaLanguageVersion.of(25)) } }

dependencies {
    implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
    implementation("org.springframework.boot:spring-boot-starter")
    implementation("com.knoden.aisl:aisl-runtime:0.8.1")
}

That’s the whole application: ./gradlew bootRun prints a one-sentence summary from the model on your machine. The user guide covers the rest, with the Gradle setup for the .aisl compiler.

Read more

Rough edges

  • Pre-1.0: APIs can still change between minor versions.
  • Not on Maven Central yet, hence the repository block.
  • Built around Ollama: the per-skill model and thinking settings are Ollama options.
  • A method can’t return List<Appointment> directly; wrap the list in a record.

Questions and bug reports are welcome as GitLab issues, or write to hello@pim.knoden.com.