gollek-ml-api
The gollek-ml-api module serves as the primary high-level faรงade for the entire Gollek ML framework. It provides a unified entry point, masking the complexity of underlying tensor operations, autograd engines, and hardware backends.
๐ Overview
This module is designed for developers who want to integrate ML capabilities into their Java applications without diving into low-level tensor manipulation. It provides a fluent builder API for model instantiation and execution.
๐ Key Features
- Unified SDK Entry Point: The
Gollekclass provides access to all major framework features. - Fluent Builder Pattern: Simplified model and device configuration.
- Pipeline Orchestration: Built-in support for text, vision, and multi-modal pipelines.
- Hardware Agnostic: Automatically selects the best available backend (CUDA, Metal, CPU).
๐ฆ Installation
Add the following dependency to your pom.xml:
<dependency>
<groupId>tech.kayys.gollek</groupId>
<artifactId>gollek-ml-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
๐ ๏ธ Usage Examples
Initializing the SDK
import tech.kayys.gollek.ml.Gollek;
// Initialize with automatic device detection
Gollek sdk = Gollek.builder()
.model("qwen-0.5b")
.build();
System.out.println("Running on: " + sdk.getDevice());
Simple Text Completion
String prompt = "Neural networks are";
String completion = sdk.generate(prompt);
System.out.println(completion);
๐ API Highlights
tech.kayys.gollek.ml.Gollek
The central entry point for the SDK.
| Method | Description |
|---|---|
builder() |
Returns a new Gollek.Builder instance. |
generate(String prompt) |
Performs high-level text generation. |
getDevice() |
Returns the active Device being used for execution. |
close() |
Releases native resources and cleans up memory. |
tech.kayys.gollek.ml.Gollek.Builder
Configures the SDK instance.
| Method | Description |
|---|---|
model(String modelPath) |
Sets the target model (HuggingFace ID or local path). |
device(String deviceType) |
Manually specifies the device (CPU, CUDA, METAL). |
precision(String type) |
Sets execution precision (FP32, FP16, INT8). |
build() |
Creates the Gollek instance. |