81 const std::string& tool_grammar) {
97 const std::string& tool_grammar) {
98 return !request_grammar.empty() && !tool_grammar.empty();
Activate model on GPU (WARM → ACTIVE).
GrammarSource resolve_grammar_source(const std::string &request_grammar, const std::string &tool_grammar)
Resolve which grammar wins.
bool grammar_sources_collide(const std::string &request_grammar, const std::string &tool_grammar)
Whether both sources are active — a config error worth reporting.
GrammarSource
Which source, if any, constrains the decode.
@ request
GenerationParams::grammar (COMMON_GRAMMAR_TYPE_USER)
@ tool_call
Render-derived (COMMON_GRAMMAR_TYPE_TOOL_CALLS, needs prefill)
@ count
Sentinel — MUST remain last.
constexpr int grammar_source_count()
Number of declared grammar sources, sentinel excluded.