β‘ A zero-latency, asynchronous orchestration runtime connecting LLM brains and conversation memory.
FastAIBot is the orchestrator of the FastJava ecosystem. It bridges the pure AI generation of FastAI with persistent state (FastAIMemory) and streaming interfaces.
By streaming LLM output tokens in real-time, FastAIBot enables instant responses without JSON-parsing latency.
import fastaibot.FastAIBot;
import fastai.FastAI;
import fastai.AI;
import java.util.function.Consumer;
public class Demo {
public static void main(String[] args) {
// 1. Connect the Brain
AI brain = FastAI.connect("gemini:gemini-2.5-flash", "api-key");
// 2. Define Text Output Consumer
Consumer<String> textOut = text -> System.out.print(text);
// 3. Boot the Bot
FastAIBot bot = new FastAIBot(brain, "You are a helpful AI...", textOut);
// 4. Talk (Streams instantly)
bot.streamChat("Are you a bot in a monitor?");
}
}- Why FastAIBot?
- Key Features
- Architecture Overview (FastAIBot vs FastAI)
- API Quick Reference
- Installation
- Documentation
- Platform Support
- License
Traditional AI frameworks add heavy abstraction layers and slow JSON parsing overhead, introducing noticeable latency to live interactions. FastAIBot provides a zero-latency, high-performance orchestration layer for Java. It connects FastAI's stateless LLM stream directly with FastAIMemory's context history, streaming incoming response tokens to your application in real-time.
- π« Zero Lag Streaming β Passes tokens directly as they arrive without JSON-parsing overhead.
- π§ Context Awareness β Seamlessly integrates with
FastAIMemoryfor session persistence. - β‘ State-Minimized β Built entirely in pure Java with zero heavy framework bloat.
FastAI (The Brain)
Minimalist, hyper-fast Java LLM client.
- Zero dependencies.
- No event system.
- No state management. β Input: Prompt in, Tokens out.
FastAIMemory (The Memory)
Module for managing conversation contexts and histories.
- ConversationHistory: Stores and structures dialogue histories (System, User, Assistant).
- MemoryContextBuilder: Constructs formatted context prompts for LLMs.
FastAIBot (The Orchestrator)
Lightweight orchestrator runtime for interactive bot systems.
- Connects
FastAI(LLM inference) andFastAIMemory(context management). - Manages real-time multi-turn conversation flow and streams tokens without overhead.
| Method | Description | Path |
|---|---|---|
streamChat(String) |
Sends input to FastAI and streams the mixed output. | Reference β |
getHistory() |
Returns the active ConversationHistory. |
Reference β |
Tip
See REFERENCE.md for full documentation.
FastAIBot integrates with the FastJava ecosystem modules for LLM streaming, memory context management, and native SIMD String acceleration.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastAIBot Orchestrator -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastaibot</artifactId>
<version>0.1.2</version>
</dependency>
<!-- FastAI & FastAIMemory -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastAI</artifactId>
<version>0.1.4</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastAIModel</artifactId>
<version>0.1.1</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastAIMemory</artifactId>
<version>0.1.3</version>
</dependency>
<!-- FastJava Core & Utility Dependencies -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastString</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastJSON</artifactId>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastCore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:fastaibot:0.1.2'
implementation 'com.github.andrestubbe:FastAI:0.1.4'
implementation 'com.github.andrestubbe:FastAIModel:0.1.1'
implementation 'com.github.andrestubbe:FastAIMemory:0.1.3'
implementation 'com.github.andrestubbe:FastString:0.1.0'
implementation 'com.github.andrestubbe:FastJSON:0.1.2'
implementation 'com.github.andrestubbe:FastCore:0.1.0'
}Download the required JARs directly to add them to your classpath:
- π€ fastaibot-0.1.2.jar (Bot Orchestrator)
- β‘ fastai-0.1.4.jar (LLM Engine)
- π¦ FastAIModel-0.1.1.jar (Local GGUF / llama.cpp & ONNX Model Engine)
- π§ FastAIMemory-0.1.3.jar (Context & History)
- π FastString-0.1.0.jar (Zero-Copy Buffer)
- π¦ FastJSON-0.1.2.jar (JSON Parser)
- βοΈ fastcore-0.1.0.jar (Mandatory Native Loader)
Important
All JARs must be included in your classpath for the native JNI bindings and context pipelines to function correctly.
- REFERENCE.md: Full API contracts and routing logic.
- PHILOSOPHY.md: The "Zero Latency" orchestrator philosophy.
- COMPILE.md: Build instructions.
- CHANGELOG.md: Project history.
- ROADMAP.md: Future development goals.
| Platform | Status |
|---|---|
| Windows 10/11 (x64) | β Fully Supported |
| Linux | π§ Planned |
| macOS | π§ Planned |
MIT License β See LICENSE file for details.
Part of the FastJava Ecosystem β Making the JVM faster. Small package. Maximum speed. Zero bloat. ππ
