Documentation
¶
Overview ¶
Package litertlmgo is the module root for litertlm-go.
Consumers import the actual Go API from the subpackages:
import "github.com/vladimirvivien/litertlm-go/pkg/litertlm" import "github.com/vladimirvivien/litertlm-go/pkg/loader"
See README.md for the full usage guide and LITERTLM-BUILD.md for the native-library build recipe.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
cancel
command
cancel demonstrates aborting an in-flight streaming generation using the high-level Client.GenerateStream API and context cancellation.
|
cancel demonstrates aborting an in-flight streaming generation using the high-level Client.GenerateStream API and context cancellation. |
|
chat
command
chat demonstrates multi-turn conversation using the high-level Client.NewChat / Chat.Send API.
|
chat demonstrates multi-turn conversation using the high-level Client.NewChat / Chat.Send API. |
|
conversation
command
conversation showcases the full tool-using flow on the high-level Chat API: declare a tool, send a user prompt, dispatch the structured tool_call the model returns, send the result back, read the final natural-language answer.
|
conversation showcases the full tool-using flow on the high-level Chat API: declare a tool, send a user prompt, dispatch the structured tool_call the model returns, send the result back, read the final natural-language answer. |
|
gpu
command
gpu demonstrates GPU-accelerated local inference plus BenchmarkInfo readout (init time, time-to-first-token, prefill/decode throughput).
|
gpu demonstrates GPU-accelerated local inference plus BenchmarkInfo readout (init time, time-to-first-token, prefill/decode throughput). |
|
hello
command
hello demonstrates a minimal synchronous inference using the high-level Client API.
|
hello demonstrates a minimal synchronous inference using the high-level Client API. |
|
prefill-decode
command
prefill-decode demonstrates the explicit two-phase generation flow: RunPrefill seeds the session with the prompt context, RunDecode then produces the response.
|
prefill-decode demonstrates the explicit two-phase generation flow: RunPrefill seeds the session with the prompt context, RunDecode then produces the response. |
|
score
command
score demonstrates per-target text scoring: prefill the prompt, then score one candidate completion and inspect its log-probability score and tokenized length.
|
score demonstrates per-target text scoring: prefill the prompt, then score one candidate completion and inspect its log-probability score and tokenized length. |
|
stream
command
stream demonstrates token-by-token streaming using the high-level Client.GenerateStream API (range-over-func iterator).
|
stream demonstrates token-by-token streaming using the high-level Client.GenerateStream API (range-over-func iterator). |
|
structured
command
structured demonstrates type-safe structured-output extraction with litertlm.GenerateData[T].
|
structured demonstrates type-safe structured-output extraction with litertlm.GenerateData[T]. |
|
tokenize
command
tokenize demonstrates the engine's tokenizer round-trip: text → []int32 token ids → text.
|
tokenize demonstrates the engine's tokenizer round-trip: text → []int32 token ids → text. |
|
pkg
|
|
|
litertlm
Package litertlm is a purego-backed, cgo-free Go wrapper around Google's LiteRT-LM C API (see c/engine.h in the LiteRT-LM repository).
|
Package litertlm is a purego-backed, cgo-free Go wrapper around Google's LiteRT-LM C API (see c/engine.h in the LiteRT-LM repository). |
|
loader
Package loader resolves and loads the LiteRT-LM native shared library.
|
Package loader resolves and loads the LiteRT-LM native shared library. |
|
utils
Package utils provides platform-abstracted helpers for marshalling strings across the Go/C FFI boundary.
|
Package utils provides platform-abstracted helpers for marshalling strings across the Go/C FFI boundary. |
Click to show internal directories.
Click to hide internal directories.