Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
grammar_registry.h File Reference

GrammarRegistry — named grammar management and validation. More...

#include <entropic/types/config.h>
#include <filesystem>
#include <mutex>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for grammar_registry.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  entropic::GrammarRegistry
 Centralized grammar registry for named GBNF grammars. More...
 

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Detailed Description

GrammarRegistry — named grammar management and validation.

Responsibilities:
  • Load bundled grammars from data/grammars/ at startup
  • Register/deregister grammars by name at runtime
  • Resolve grammar_key to GBNF content string for generation
  • Validate GBNF grammar syntax without generating
Thread safety:
  • get() and has() are lock-free (read under shared lock)
  • register/deregister acquire registry_mutex_
  • Validation is stateless and thread-safe
Ownership:
Owned by ModelOrchestrator. One GrammarRegistry per engine instance. Replaces the _grammar_cache dict and _resolve_grammar() method from the Python orchestrator.
Version
1.9.3

Definition in file grammar_registry.h.