[object Object]

← back to Exo

Fix Kimi K2 Thinking download by adding tiktoken.model to download patterns (#1024)

b4651340122765e7b5348a9fb71f9439153efcef · 2025-12-28 19:30:31 +0000 · Drifter4242

Kimi-K2 Thinking uses tiktoken.model for its tokenizer, which wasn't
being downloaded. This adds it to the default_patterns alongside
tokenizer.model.
I'm a bit confused why this isn't a problem for other people - I know
that others have used Kimi K2 (I wonder if they manually fixed the
download).

## Motivation

I downloaded Kimi K2 Thinking and it didn't work because it didn't
download tiktoken.model file.

## Changes

Added tiktoken.model to the default patterns.

## Why It Works

Now downloads the file.

## Test Plan

### Manual Testing

I have two Macbook Studio M3 Ultras, each with 512Gb ram, connected with
Thunderbolt 5. I ran Kimi K2 Thinking with MLX Ring and Tensor Split. It
ran successfully.

### Automated Testing
No automated test changes. I don't think they are needed.

Files touched

Diff

commit b4651340122765e7b5348a9fb71f9439153efcef
Author: Drifter4242 <davehind@yahoo.co.uk>
Date:   Sun Dec 28 19:30:31 2025 +0000

    Fix Kimi K2 Thinking download by adding tiktoken.model to download patterns (#1024)
    
    Kimi-K2 Thinking uses tiktoken.model for its tokenizer, which wasn't
    being downloaded. This adds it to the default_patterns alongside
    tokenizer.model.
    I'm a bit confused why this isn't a problem for other people - I know
    that others have used Kimi K2 (I wonder if they manually fixed the
    download).
    
    ## Motivation
    
    I downloaded Kimi K2 Thinking and it didn't work because it didn't
    download tiktoken.model file.
    
    ## Changes
    
    Added tiktoken.model to the default patterns.
    
    ## Why It Works
    
    Now downloads the file.
    
    ## Test Plan
    
    ### Manual Testing
    
    I have two Macbook Studio M3 Ultras, each with 512Gb ram, connected with
    Thunderbolt 5. I ran Kimi K2 Thinking with MLX Ring and Tensor Split. It
    ran successfully.
    
    ### Automated Testing
    No automated test changes. I don't think they are needed.
---
 src/exo/worker/download/huggingface_utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/exo/worker/download/huggingface_utils.py b/src/exo/worker/download/huggingface_utils.py
index f83e5a55..8a1b179e 100644
--- a/src/exo/worker/download/huggingface_utils.py
+++ b/src/exo/worker/download/huggingface_utils.py
@@ -95,7 +95,15 @@ def extract_layer_num(tensor_name: str) -> int | None:
 
 def get_allow_patterns(weight_map: dict[str, str], shard: ShardMetadata) -> list[str]:
     default_patterns = set(
-        ["*.json", "*.py", "tokenizer.model", "*.tiktoken", "*.txt", "*.jinja"]
+        [
+            "*.json",
+            "*.py",
+            "tokenizer.model",
+            "tiktoken.model",
+            "*.tiktoken",
+            "*.txt",
+            "*.jinja",
+        ]
     )
     shard_specific_patterns: set[str] = set()
     if weight_map:

← eabdcab9 Fix linux docs (#1022)  ·  back to Exo  ·  placement: generate per-node host lists for MLX ring backend b5d424b6 →