Skip to content

Commit 039944c

Browse files
slayofferclaude
andauthored
feat(docker): preload tiktoken encoding during build (#249)
Pre-download cl100k_base tiktoken encoding (used by OpenAI models) during Docker build to avoid runtime download delays. Applied to both api-only and standalone stages. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ef9d3a1 commit 039944c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docker/standalone/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ print('Downloading embedding model...'); \
185185
SentenceTransformer('BAAI/bge-small-en-v1.5'); \
186186
print('Downloading cross-encoder model...'); \
187187
CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2'); \
188+
print('Downloading tiktoken encoding...'); import tiktoken; tiktoken.get_encoding('cl100k_base'); \
188189
print('Models cached successfully')" && break; \
189190
if [ $i -lt $MAX_RETRIES ]; then \
190191
echo "Attempt $i failed, retrying in ${RETRY_DELAY}s..."; \
@@ -310,6 +311,7 @@ print('Downloading embedding model...'); \
310311
SentenceTransformer('BAAI/bge-small-en-v1.5'); \
311312
print('Downloading cross-encoder model...'); \
312313
CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2'); \
314+
print('Downloading tiktoken encoding...'); import tiktoken; tiktoken.get_encoding('cl100k_base'); \
313315
print('Models cached successfully')" && break; \
314316
if [ $i -lt $MAX_RETRIES ]; then \
315317
echo "Attempt $i failed, retrying in ${RETRY_DELAY}s..."; \

0 commit comments

Comments
 (0)