Entropic 2.9.4
Local-first agentic inference engine
Loading...
Searching...
No Matches
llama_cpp_tokenizer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
16#pragma once
17
19
20// Forward-declare the opaque llama vocab — keeps llama.h out of the
21// public header surface. The .cpp pulls in llama.h for real calls.
22struct llama_vocab;
23
24namespace entropic {
25
36public:
42 explicit LlamaCppTokenizer(const llama_vocab* vocab);
43
44 std::vector<int32_t> tokenize(
45 const std::string& text, bool add_special) const override;
46
47 std::string detokenize(int32_t token) const override;
48
49private:
50 const llama_vocab* vocab_;
51};
52
53} // namespace entropic
Tokenizer adapter that forwards to llama.cpp's vocab API.
std::string detokenize(int32_t token) const override
Decode a single token id to its surface string.
std::vector< int32_t > tokenize(const std::string &text, bool add_special) const override
Encode text into token ids via the wrapped vocab.
Pure-virtual tokenizer surface used by the inference backend.
Definition tokenizer.h:40
Activate model on GPU (WARM → ACTIVE).
Abstract Tokenizer seam for backend testability (v2.3.10).