{"record":{"id":"356b1ff6581aea01","repo":"sgl-project/sglang","slug":"hicache-host-memory-mode-buffer-only-is-only-imp","errorCode":null,"errorMessage":"--hicache-host-memory-mode buffer_only is only implemented for the unified radix tree; this model selected {type(cache).__name__}.","messagePattern":"--hicache-host-memory-mode buffer_only is only implemented for the unified radix tree; this model selected (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/registry.py","lineNumber":223,"sourceCode":"            raise ValueError(\n                f\"--radix-cache-backend={name!r} is not registered. \"\n                f\"Registered backends: {registered_radix_cache_backends()}. \"\n                \"External backends must call register_radix_cache_backend(...) at import time.\"\n            )\n        cache = factory(ctx)\n        source = f\"registered({name!r})\"\n    else:\n        cache = default_radix_cache_factory(ctx)\n        source = \"default\"\n\n    if (\n        get_memory().enable_hierarchical_cache\n        and ctx.server_args.hicache_host_memory_mode == \"buffer_only\"\n    ):\n        from sglang.srt.mem_cache.unified_radix_cache import UnifiedRadixCache\n\n        if not isinstance(cache, UnifiedRadixCache):\n            raise ValueError(\n                \"--hicache-host-memory-mode buffer_only is only implemented for \"\n                f\"the unified radix tree; this model selected {type(cache).__name__}.\"\n            )\n\n    if ctx.server_args.enable_session_radix_cache and not getattr(\n        cache, \"enable_session_radix_cache\", False\n    ):\n        raise ValueError(\n            \"--enable-session-radix-cache requires UnifiedRadixCache, but \"\n            f\"tree_cache is {type(cache).__name__}. Drop the flag or the \"\n            \"option that selected another tree cache for this model.\"\n        )\n\n    hicache_attached = cache.cache_controller is not None\n    streaming_wrapped = False\n    if (\n        ctx.server_args.enable_streaming_session\n        and not cache.supports_streaming_session()","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/registry.py#L205-L241","documentation":"create_tree_cache validates that --hicache-host-memory-mode buffer_only is only implemented for UnifiedRadixCache. If the chosen backend/model combination produced a different cache class (e.g. the C++ tree or a custom registered backend), startup fails with this ValueError.","triggerScenarios":"Launching with --hicache-host-memory-mode buffer_only together with --radix-cache-backend selecting a non-unified cache (cpp backend, custom plugin), or a model/config whose default factory returns a non-UnifiedRadixCache.","commonSituations":"Mixing experimental flags: enabling buffer_only host mode while testing the C++ radix tree or a third-party cache backend.","solutions":["Drop --hicache-host-memory-mode buffer_only, or use the default unified radix tree","Switch --radix-cache-backend to the unified/default backend","If you wrote a custom backend, either subclass/wrap UnifiedRadixCache or implement buffer_only support"],"exampleFix":"# before\n--hicache-host-memory-mode buffer_only --radix-cache-backend cpp\n# after\n--hicache-host-memory-mode buffer_only  # default unified tree","handlingStrategy":"validation","validationCode":"if server_args.hicache_host_memory_mode == \"buffer_only\" and server_args.radix_cache_backend not in (None, \"\"):\n    raise ValueError(\"buffer_only requires the unified radix tree\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a matrix of flag-compatibility assertions in launch tooling"],"tags":["hicache","buffer-only","unified-cache","server-args","value-error"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}