Last updated: 2026-09-07
CLI & Entrypoints
ZINC CLI
CLI entrypoints for configuring ZINC and starting local inference.
This module wires together GPU initialization, model loading, tokenization, and the single-process decode loop used for prompt-mode execution.
7 exports shown
variable
is_debug_mode
pub var is_debug_mode: bool = false Global flag enabling verbose debug log output when `--debug` is passed or the `ZINC_DEBUG` env var is set.
constant
std_options
pub const std_options = std.Options{ Zig standard library options — sets log level to debug and wires the custom log function.
function
myLogFn
pub fn myLogFn( comptime level: std.log.Level, comptime scope: @TypeOf(.enum_literal), comptime format: []const u8, args: anytype, ) void Custom log handler that filters debug messages unless `is_debug_mode` is set.
struct
Config
pub const Config = struct Runtime configuration built from CLI flags and default values.
enum
Command
pub const Command = enum Top-level CLI subcommands parsed from argv.
function
parseArgs
pub fn parseArgs(args: []const [:0]const u8) !Config Parse the process argument vector into a validated runtime configuration.
function
main
pub fn main() !void Parse arguments, dispatch model-management commands, run diagnostics, or start inference.
In prompt mode the engine runs up to `max_tokens` forward passes and prints the decoded output. In server mode an HTTP listener is started and requests are handled until SIGINT/SIGTERM.