MCPcopy Index your code
hub / github.com/mudler/LocalAI / _get

Method _get

backend/python/mlx/mlx_cache.py:129–134  ·  view source on GitHub ↗

Get a cache entry by traversing the trie.

(self, model, tokens: Tuple[int, ...])

Source from the content-addressed store, hash-verified

127 return SearchResult(model, None, shorter, longer, common_prefix)
128
129 def _get(self, model, tokens: Tuple[int, ...]) -> CacheEntry:
130 """Get a cache entry by traversing the trie."""
131 current = self._cache[model]
132 for tok in tokens:
133 current = current[tok]
134 return current["cache"]
135
136 def _delete(self, model, tokens: Tuple[int, ...]) -> None:
137 """Delete a cache entry and clean up empty trie nodes."""

Callers 2

_extractMethod · 0.95
fetch_nearest_cacheMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected