OpenCV DNN module lives in the main repository under opencv/modules/dnn. This public API is declared in headers like modules/dnn/include/opencv2/dnn/dnn.hpp, and for the implementation details modules/dnn/src/. This is where I need to spend a significant time looking over the code to familiarzie with opencv conventions.
The cv::dnn::Net is the central call representing a neural network graph. It allows loadinf models, setting inputs, and running forward passes. The Net class is the backbone of DNN inference and something that needs to understand to interact with the tokenizer with a text generation model.
The cv::dnn::Layer is the base class for neural network layers. This is more relevant if adding new layer types.
The Blobs cv::Mat doesn't use a custom blob type; it uses cv::Mat a n-dimensional array to hold data. Utility functions like cv::dnn::blobFromImage help create 4D blobs for network input. In our case tokenized text could be fed into a network as a 1D vecor of token ID's in a Mat.
Opencv core modules/core provides some utilities that we might need for the tokenizer. For example, file I/O cv::FileStorage to load vababulary files, or basic data structures like cv::String, opencv owns implementation equivalent to std::string for handling text. We also need to keep in mind that opencv has custome types built in such as cv::String, cv::Ptr