Using Letta Desktop with a local Letta server via Docker. Using Ollama for both LLM and embedding. Discovered that when I’m away from the internet, it doesn’t work, which confused me because everything I’ve set up is local.
In looking at the terminal, I noted this error:
File “/app/.venv/lib/python3.11/site-packages/requests/adapters.py”, line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘openaipublic.blob.core.windows.net’, port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by NameResolutionError(“<urllib3.connection.HTTPSConnection object at 0xffff8a3c5d90>: Failed to resolve ‘openaipublic.blob.core.windows.net’ ([Errno -2] Name or service not known)”))
Is there a reason Letta Desktop is reaching out to openaipublic?
Is there something I can do to have a working system when I’m not connected to the internet?
Name it using the SHA-1 of the blob URL (tiktoken uses that as the cache filename) or simply run a Python step during image build to force caching. Example Docker approaches:
In Dockerfile run: RUN python -c “import tiktoken; tiktoken.get_encoding(‘cl100k_base’)” (this makes tiktoken download & cache the file at build time)
Or download and add the file directly and set ENV TIKTOKEN_CACHE_DIR=/opt/tiktoken and place the file at /opt/tiktoken/
Letta calls out to remote embedding services by default, so make sure you set the embedding model to use the Ollama ones.
Great solutions from Cameron! Let me add some additional implementation details and alternatives:
Complete Offline Setup
Method 1: Docker build-time caching (Recommended)
# Add this to your Dockerfile before the main application
RUN python -c "import tiktoken; tiktoken.get_encoding('cl100k_base')"
Method 2: Manual tokenizer placement
# Calculate SHA-256 hash of the URL (tiktoken uses this for filename)
echo -n "https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken" | sha256sum
# Download and place file
wget https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken
mkdir -p /opt/tiktoken
mv cl100k_base.tiktoken /opt/tiktoken/[hash_result]
# Set environment variable
export TIKTOKEN_CACHE_DIR=/opt/tiktoken
Method 3: Volume mount approach (for existing containers)
# Run once online to populate cache
docker run --rm -v tiktoken_cache:/root/.cache/tiktoken your_letta_image python -c "import tiktoken; tiktoken.get_encoding('cl100k_base')"
# Then mount the cache volume in your main container
docker run -v tiktoken_cache:/root/.cache/tiktoken your_letta_image
Embedding Configuration
Ensure your Letta config uses local Ollama embeddings:
letta configure
# Select Ollama for embedding provider
# Choose your preferred model (e.g., nomic-embed-text)
This tokenizer dependency exists because Letta uses OpenAI’s tokenization format for consistent token counting across different LLMs, even when using Ollama.