69 std::string open_marker, std::string close_marker);
87 void on_token(
const char* chunk,
size_t len);
104 void* raw_ud_ =
nullptr;
113 bool match_tag(
const std::string& buf,
bool& is_open)
const;
115 bool in_think_ =
false;
117 std::string open_marker_ =
"<think>";
118 std::string close_marker_ =
"</think>";
121 std::size_t max_marker_len_ = 8;
122 std::string tag_buf_;
123 std::string utf8_buf_;
132 void emit_utf8_safe(
const char* data,
size_t len);
139 void process_byte(
char c);
Streaming filter that removes <think> blocks from output.
void set_raw_callback(TokenCallback cb, void *ud)
Set optional raw callback (receives ALL tokens unfiltered).
void on_token(const char *chunk, size_t len)
Process a chunk of tokens.
void flush()
Flush any buffered partial tag content.
Activate model on GPU (WARM → ACTIVE).
void(*)(const char *, size_t, void *) TokenCallback
Token callback type matching the C API signature.