37 tok/s from Qwen3-Next-80B (48 GB) on a 32 GB laptop, 24 without drafts vs 2.8 for llama.cpp; reading 62 vs 16 tok/s. Faster than llama.cpp on all 13 models compared in Q4_K_M. LLMs bigger than your RAM, pure C, CPU or GPU.
C avx2ccpu-inferenceggufinference-enginelinuxllmlocal-llmmixture-of-expertsmoenvmequantizationqwen3simdspeculative-decodingvulkan
/* SPDX-License-Identifier: GPL-3.0-or-later
Copyright (C) 2026 Maurizio Cammalleri */
/*
* schema.h - JSON and JSON Schema as grammar rules (grammar.h).
*
* What a schema says is enforced where a grammar can say it: types, the
* properties of an object (in the order the schema lists them, the required
* ones always there, no others), array items and small bounds on their
* count, string lengths up to 4096, enum and const, anyOf and oneOf, $ref
* to the same document (recursion included), nullable; minimum, maximum,
* their exclusive forms and multipleOf (up to 50) on integers, the bounds
* on numbers (schema_num.c); the formats date, time, date-time, uuid,
* email and ipv4 (schema_re.c). What it cannot say (pattern, other
* formats, allOf of more than one schema) is left out: the value is still
* valid JSON of the right type, and janas_jsg_relaxed counts the keywords
* so treated.
*/
#ifndef JANAS_LLM_SCHEMA_H
#define JANAS_LLM_SCHEMA_H
#include <stdint.h>
#include "grammar.h"
#include "json.h"
struct janas_jsg;
/* Rules for JSON, made in b (which must outlive the result's use). */
struct janas_jsg *janas_jsg_new(struct janas_gbuild *b);
void janas_jsg_free(struct janas_jsg *j);
/* White space between tokens of JSON: at most 20 bytes in a row. */
uint32_t janas_jsg_ws(struct janas_jsg *j);
/* Any JSON value; any object. */
uint32_t janas_jsg_any(struct janas_jsg *j);
uint32_t janas_jsg_object(struct janas_jsg *j);
/* A value valid against schema; root is the document $ref points into. */
uint32_t janas_jsg_schema(struct janas_jsg *j, const struct janas_json *schema,
const struct janas_json *root);
/* Keywords seen and not enforced. */
int janas_jsg_relaxed(const struct janas_jsg *j);
#endif