def METHOD_NAME(self, request: TokenizationRequest) -> TokenizationRequestResult:
    cache_key = asdict(request)
    raw_request = {
        "text": request.text,
        "truncation": request.truncation,
        "max_length": request.max_length,
    }
    try:
        def do_it():
            url = f"{self.base_url}/tokenize"
            response = requests.post(url, json=raw_request)
            response.raise_for_status()
            response_data = response.json()
            return response_data
        if self.cache:
            result, cached = self.cache.get(cache_key, wrap_request_time(do_it))
        else:
            result, cached = do_it(), False
    except Exception as e:
        error: str = f"Local Model error: {e}"
        return TokenizationRequestResult(success=False, cached=False, error=error, text="", tokens=[])
    return TokenizationRequestResult(
        success=True,
        cached=cached,
        text=request.text,
        tokens=[TokenizationToken(value) for value in result["tokens"]],
        request_time=result["request_time"],
    )