From 8dd30690050c3678d41fd1a26ffb6cd18eb8cefd Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 5 Aug 2025 14:22:19 +0800 Subject: [PATCH] feat: add tiktoken cache directory support for offline deployment - Mount tiktoken cache volume in docker-compose - Add TIKTOKEN_CACHE_DIR environment variable - Update env.example with tiktoken cache configuration - Added /data to gitignore - Added tiktoken env example --- .gitignore | 1 + docker-compose.yml | 3 +++ env.example | 3 +++ 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index a1b10a90..dc48605d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ rag_storage/ examples/input/ examples/output/ output*/ +data/ # Miscellaneous .DS_Store diff --git a/docker-compose.yml b/docker-compose.yml index da71faf8..2881b5c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,10 +12,13 @@ services: volumes: - ./data/rag_storage:/app/data/rag_storage - ./data/inputs:/app/data/inputs + - ./data/tiktoken:/app/data/tiktoken - ./config.ini:/app/config.ini - ./.env:/app/.env env_file: - .env + environment: + - TIKTOKEN_CACHE_DIR=/app/data/tiktoken restart: unless-stopped extra_hosts: - "host.docker.internal:host-gateway" diff --git a/env.example b/env.example index fae8122a..9de38d30 100644 --- a/env.example +++ b/env.example @@ -20,6 +20,9 @@ WEBUI_DESCRIPTION="Simple and Fast Graph Based RAG System" # INPUT_DIR= # WORKING_DIR= +### Tiktoken cache directory (Store cached files in this folder for offline deployment) +# TIKTOKEN_CACHE_DIR=./temp/tiktoken + ### Ollama Emulating Model and Tag # OLLAMA_EMULATING_MODEL_NAME=lightrag OLLAMA_EMULATING_MODEL_TAG=latest