Documentation Hub
Gollek SDK Documentation
Comprehensive guides, API references, and examples for building AI-powered applications with Gollek SDK.
π Getting Started
Installation, quickstart, and setup guides.
π Core Concepts
Architecture, API reference, and fundamentals.
π¦ Model Formats
GGUF, ONNX, TFLite, audio, and quantization.
π¬ Advanced
GPU kernels, audio processing, and plugins.
π‘ Examples
JBang scripts, tutorials, and code samples.
π Support
Troubleshooting, error codes, and help.
Getting Started
Essential guides to get you up and running quickly.
SDK Installation
Install Gollek as a Maven/Gradle dependency for use in Java projects. Includes quick start examples and GPU acceleration setup.
Maven Setup:
<dependency>
<groupId>tech.kayys.gollek</groupId>
<artifactId>gollek-ml-ml</artifactId>
<version>0.3.0-SNAPSHOT</version>
</dependency>
JBang Setup
Run Gollek examples without build tools. JBang handles all dependencies automatically.
Quick Start:
curl -Ls https://sh.jbang.dev | bash -s -
jbang examples/jbang/sdk/unified_framework_demo.java --demo all
Trainer JBang Docs
Routing page for the terminal-first trainer lane.
Use it for:
- generic trainer runtime entrypoints
- Byte-Latent trainer workflows
- DiffusionOPD trainer/report workflows
- Recursive Reasoning trainer/report workflows
CLI Installation
Install the Gollek CLI via release installer, Homebrew, or Chocolatey for macOS, Linux, and Windows.
Quick Install:
# macOS/Linux
curl -sSL https://raw.githubusercontent.com/bhangun/gollek/main/scripts/install.sh | bash
# Windows
winget install gollek
GitHub Packages Deployment
Use Gollek SDK in Maven projects via GitHub Packages. Configure repositories, authenticate, and manage dependencies.
Maven Setup:
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/bhangun/gollek</url>
</repository>
Core API
Main entry point for all SDK operations. Learn about GollekLocalClient, InferenceRequest, InferenceResponse, and completion APIs.
Key Topics:
- Creating SDK instances
- Building inference requests
- Executing synchronous and streaming inference
- Async jobs and batch processing
Examples
Code examples and usage patterns for common scenarios including streaming, async jobs, and provider selection.
Examples Docs
Landing page for choosing between code examples, broad JBang examples, and trainer-specific JBang workflows.
π v0.3 New Features
Unified Model Runner
Single API for all frameworks (GGUF, ONNX, LiteRT, TensorRT). No more framework-specific code.
ModelRunner runner = ModelRunner.builder()
.modelPath("model.onnx")
.device(RunnerDevice.CUDA)
.build();
Dynamic Batching Engine
Automatic request batching with SLA enforcement. 5-10x throughput improvement.
Graph Fusion Engine
Fuse multiple operations into single kernels. 3-10x speedup from reduced launch overhead.
Quantization Engine
INT4/INT8/FP8 quantization with AWQ/GPTQ algorithms. 4-8x memory reduction.
Shared Memory Pool
Zero-copy tensor allocation across frameworks. Unified memory management.
Core Concepts
Fundamental concepts and architecture documentation.
Architecture
System architecture overview including SDK layers, provider system, model repository, and inference pipeline.
Diagram:
+------------------+ +-------------------+ +------------------+
| Gollek Client | --> | Inference Svc | --> | Providers |
+------------------+ +-------------------+ +------------------+
Core Runtime Architecture
Deep dive into the runtime engine, execution model, and performance characteristics.
Plugin System v2
Extensible plugin architecture for custom providers, features, and runners.
Plugin Types:
- Feature Plugins: Add new capabilities
- Runner Plugins: Model format support (GGUF, ONNX, etc.)
- Kernel Plugins: Hardware acceleration (CUDA, Metal, ROCm)
Enhanced Plugin Architecture
Advanced plugin patterns with kernel auto-detection and isolation strategies.
Enhanced Runner Plugin Architecture
Building custom model runners with enhanced plugin system.
Feature Plugins
Extend Gollek with custom features and capabilities.
Optimization Plugins
Performance optimization plugins for inference acceleration.
Plugin Examples
Working examples of plugin implementations.
Plugin Templates
Starter templates for building your own plugins.
Plugin Migration
Migrate from v1 to v2 plugin system.
Enhanced Plugin System v2
Complete guide to the enhanced plugin architecture.
Kernel Auto-Detection
Automatic hardware kernel detection and selection.
Storage Layout
Understanding Gollekβs local storage structure for models and caches.
Default Location: ~/.gollek/
Enhancement History
Complete development history and changelog.
Phase 1 Completion
Integration testing results and milestones (41 tests passed).
Phase 2 Completion
Performance optimization results (3x throughput improvement).
Model Formats
Supported model formats and conversion tools.
GGUF Enhancements
K-quant support (Q2_K, Q4_K, Q5_K, Q6_K), 40+ model families, and quantization improvements.
Supported Families:
- Llama, Mistral, DeepSeek, Yi, DBRX, Grok, Jamba, Mamba, RWKV
Quantization
GPTQ INT4/INT8 and FP8 quantization with SafeTensors format for 4-8x compression.
Quantization Types:
- GPTQ INT4: 8x compression
- INT8: 4x compression
- FP8: GPU tensor core optimization
Safetensor Runner Integration
Direct inference from Safetensors format models.
Runner Plugins
Model runner implementations for different formats.
MOSS TTS ONNX Audio
Local text-to-speech through the MOSS TTS Nano ONNX pipeline with companion codec orchestration, voice presets, Suling WAV/FLAC/MP3 output, and live PCM preview.
CLI Recipes:
- Balanced MP3:
--voice "en Trump" --audio-quality balanced --output hello.mp3 - Lossless FLAC:
--audio-quality lossless --output hello.flac - Live preview:
--live-audio --output hello.mp3
Advanced Topics
Advanced features and specialized capabilities.
GPU Runtime Docs
Native CUDA, Blackwell, ROCm, and Metal kernels with FlashAttention-2/3.
Supported Hardware:
- NVIDIA CUDA (including Blackwell)
- AMD ROCm
- Apple Metal (M1/M2/M3)
Audio Processing Docs
Speech-to-text, text-to-speech, audio encoding, and VAD pipeline.
Capabilities:
- STT: Whisper with 99+ languages
- TTS: MOSS TTS ONNX with voice selectors and companion codec discovery
- Encoding: Suling WAV/FLAC/MP3 output, including FFmpeg-backed MP3
- VAD: Voice activity detection
- Streaming: Progress events, encoded chunks, and optional live PCM preview
Multimodal SDK
Vision-language models and multimodal inference.
ML SDK
Embedded ML SDK: PyTorch-like Tensors, Autograd, NN Modules, and training in pure Java.
Features:
- Tensor operations with autograd
- Neural network layers (Linear, Conv, Attention)
- Loss functions and optimizers
- Model persistence (GGUF, Safetensors)
Native Library Guide
Building and using native libraries with Gollek.
Native FFI
GraalVM native image support with C FFI for embedded integration.
Native Compilation
Compiling Gollek to native executables.
Developer Guidance
Best practices, tips, and tricks for Gollek development.
Topics:
- Metal GPU smoke test
- LiteRT TFLite setup
- Performance tuning
- Memory management
Cloud Provider Docs
Cloud inference providers: OpenAI, Anthropic, Google Gemini, Cerebras, Mistral.
Examples & Tutorials
Hands-on examples and tutorials.
JBang Examples Catalog
23+ ready-to-run Java scripts covering:
- π’ Beginner: Hello World, templates
- π΅ Neural Networks: MLP, training, persistence
- π£ NLP: Sentiment, transformers, chatbots
- π ML Integrations: DL4J, Stanford NLP, Smile, Tribuo
Quick Start:
jbang https://raw.githubusercontent.com/bhangun/gollek/main/gollek/sdk/integration/jbang-templates/examples/common/hello_gollek.java
Trainer JBang Docs
Terminal-first entry page for the trainer lane.
Use it for:
- generic trainer runtime routing
- Byte-Latent, DiffusionOPD, and Recursive Reasoning trainer workflows
- guided handoff into the trainer-specific advanced tutorial
Jupyter & JBang Integration
Interactive development with Jupyter notebooks and jbang scripts.
What Youβll Learn:
- Setting up Jupyter Java kernel
- Interactive model building
- Converting notebooks to scripts
- Team collaboration workflows
CLI Reference
Complete CLI command reference including gollek chat, gollek convert, and more.
Common Commands:
gollek chat --provider gemini
gollek convert --input model.safetensors --output model.gguf
gollek list-models
Support
Troubleshooting and help resources.
Troubleshooting
Common issues and solutions.
Common Problems:
- Dependency resolution failures
- Model not found errors
- GPU/CUDA issues
- Memory problems
Error Codes
Complete error code reference with descriptions and solutions.
Error Categories:
- INFERENCE_*: Inference-related errors
- MODEL_*: Model loading/management errors
- PROVIDER_*: Provider configuration errors
- RUNTIME_*: Runtime execution errors
Git Repository Cleanup
Guide for cleaning up large files from git history.
GitHub Packages Deployment
Publishing and consuming packages via GitHub Packages.
Quick Reference
Installation
# CLI (macOS/Linux)
curl -sSL https://raw.githubusercontent.com/bhangun/gollek/main/scripts/install.sh | bash
# CLI (Windows)
winget install gollek
# Maven Dependency
# See: /docs/github-packages-deployment
First Inference
GollekLocalClient client = GollekSdkFactory.createLocalSdk();
InferenceRequest request = InferenceRequest.builder()
.model("llama-3.2-3b-instruct")
.prompt("Hello, world!")
.build();
InferenceResponse response = client.createCompletion(request);
Run JBang Example
jbang https://raw.githubusercontent.com/bhangun/gollek/main/gollek/sdk/integration/jbang-templates/examples/common/hello_gollek.java
Configure API Keys
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GOOGLE_API_KEY=...
Documentation Categories
| Category | Pages | Description |
|---|---|---|
| Getting Started | 5 | Installation, setup, quickstart |
| Core Concepts | 15 | Architecture, API, plugins |
| Model Formats | 5 | GGUF, quantization, runners |
| Advanced | 10 | GPU, audio, native, ML SDK |
| Examples | 3 | JBang, Jupyter, CLI reference |
| Support | 5 | Troubleshooting, errors, help |
Additional Resources
- Blog - Latest news and announcements
- Features - Feature overview
- GitHub - Source code and issues
- Discussions - Community discussions
| Last Updated: March 2026 | Version: 1.0.0 |