Last updated: 2026-11-17
API Server
Model Discovery
Model discovery serializer for the OpenAI-compatible /v1/models endpoint.
Produces an allocator-owned JSON byte slice listing the loaded model with its basename as `id`, a fixed `owned_by` of "zinc", and per-slot context length. Never exposes parent directories or other private metadata.
3 exports shown
struct
ChatModel
pub const ChatModel = struct No public doc comment yet.
function
serializeChatModel
pub fn serializeChatModel(allocator: std.mem.Allocator, model_path: []const u8, context_length: u32, options: ChatModel) ![]u8 Describe the already-loaded native model to the shared browser UI.
This is a single active, manually loaded model, not a hot-switchable catalog entry.
function
serializeModels
pub fn serializeModels(allocator: std.mem.Allocator, model_path: []const u8, context_length: u32) ![]u8 Model discovery serializer — produces OpenAI-compatible /v1/models JSON.
Returns an allocator-owned byte slice; caller must free with the same allocator.