You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openai_harmony.HarmonyError: error downloading or loading vocab file: failed to download or load #46
In an offline environment without a network, the following error will be reported:
File "/home/lianxintao/venv-gpt/lib/python3.12/site-packages/openai_harmony/init.py", line 689, in load_harmony_encoding
inner: _PyHarmonyEncoding = _load_harmony_encoding(name)
openai_harmony.HarmonyError: error downloading or loading vocab file: failed to download or load vocab file。
I'm not entirely sure if I did it correctly or not.
I found that a /tmp/tiktoken-rs-cache is created after running the load_harmony_encoding function.
After I uploaded and mounted the directory into the container, I can launch the model purely offline.
I'm not entirely sure if I did it correctly or not. I found that a /tmp/tiktoken-rs-cache is created after running the load_harmony_encoding function. After I uploaded and mounted the directory into the container, I can launch the model purely offline.
I want to know which files you uploaded and mounted and where I can download them? I upload 2 files but error exists though. Thx!
ls -l /tmp/tiktoken-rs-cache/
total 5176
-rw-rw-r-- 1 1002 1002 1681126 Aug 8 02:26 cl100k_base.tiktoken
-rw-rw-r-- 1 1002 1002 3613922 Aug 8 02:25 o200k_base.tiktoken
I am also receiving this error but I am on an online environment. I have the library installed in a python virtual env thats running on a RPi connected to the network but I get this error
python -c "from openai_harmony import load_harmony_encoding, HarmonyEncodingName as N; load_harmony_encoding(N.HARMONY_GPT_OSS)"
Traceback (most recent call last):
File "", line 1, in
File "/home/gh0st/env/lib/python3.11/site-packages/openai_harmony/init.py", line 689, in load_harmony_encoding
inner: _PyHarmonyEncoding = _load_harmony_encoding(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
openai_harmony.HarmonyError: error downloading or loading vocab file: failed to download or load vocab file
When running on a corporate network with TLS decryption this error also occurs. Seems that the rust implementation does not respect the system trust store.
I'm not entirely sure if I did it correctly or not. I found that a /tmp/tiktoken-rs-cache is created after running the load_harmony_encoding function. After I uploaded and mounted the directory into the container, I can launch the model purely offline.
I want to know which files you uploaded and mounted and where I can download them? I upload 2 files but error exists though. Thx!
ls -l /tmp/tiktoken-rs-cache/
total 5176
-rw-rw-r-- 1 1002 1002 1681126 Aug 8 02:26 cl100k_base.tiktoken
-rw-rw-r-- 1 1002 1002 3613922 Aug 8 02:25 o200k_base.tiktoken
Hi Red,
I uploaded the /tmp/tiktoken-rs-cache directory entirely without modifying the file names. Please give it a try.
I got this directory generated after executing the following command:
Why is this library downloading files during runtime? This causes a lot of issues in local/offline environments.
@Redias@Gh0stWires@Hexoplon I was able to get it working by setting an ENV variable named TIKTOKEN_ENCODINGS_BASE pointing to the folder with the 2 encoding files.
You do have to download both files before hand and put them in a directory on your host. The files are:
root@ai-vtraining-gpu-prd-10-121-97-208:/data# ls -l /tmp/tiktoken-rs-cache/
total 5176
-rw-r--r-- 1 root root 1681126 Dec 4 07:10 cl100k_base.tiktoken
-rw-r--r-- 1 root root 3613922 Dec 4 07:10 o200k_base.tiktoken
root@ai-vtraining-gpu-prd-10-121-97-208:/data# python -c "import openai_harmony; openai_harmony.load_harmony_encoding(openai_harmony.HarmonyEncodingName.HARMONY_GPT_OSS)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.12/dist-packages/openai_harmony/__init__.py", line 689, in load_harmony_encoding
inner: _PyHarmonyEncoding = _load_harmony_encoding(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
openai_harmony.HarmonyError: error downloading or loading vocab file: failed to download or load vocab file
root@ai-vtraining-gpu-prd-10-121-97-208:/data#
just use TIKTOKEN_RS_CACHE_DIR=/vocab/download/path python -c 'from openai_harmony import load_harmony_encoding; load_harmony_encoding("HarmonyGptOss")'
But there are some errors in your env and code. You can use an independent env to download the vocab file, and move it to where you want to use. Notify that move to /tmp/tiktoken-rs-cache/, and the vocab filename is a hash-result.
Activity
jameslai-dev commentedon Aug 7, 2025
I'm not entirely sure if I did it correctly or not.
I found that a
/tmp/tiktoken-rs-cacheis created after running theload_harmony_encodingfunction.After I uploaded and mounted the directory into the container, I can launch the model purely offline.
lianxintao commentedon Aug 7, 2025
yes, you are right,.#41
Redias commentedon Aug 8, 2025
I want to know which files you uploaded and mounted and where I can download them? I upload 2 files but error exists though. Thx!
Gh0stWires commentedon Aug 8, 2025
I am also receiving this error but I am on an online environment. I have the library installed in a python virtual env thats running on a RPi connected to the network but I get this error
Hexoplon commentedon Aug 8, 2025
When running on a corporate network with TLS decryption this error also occurs. Seems that the rust implementation does not respect the system trust store.
jameslai-dev commentedon Aug 9, 2025
Hi Red,
I uploaded the

/tmp/tiktoken-rs-cachedirectory entirely without modifying the file names. Please give it a try.I got this directory generated after executing the following command:
python -c "import openai_harmony; openai_harmony.load_harmony_encoding(openai_harmony.HarmonyEncodingName.HARMONY_GPT_OSS)"gaby commentedon Aug 10, 2025
Why is this library downloading files during runtime? This causes a lot of issues in local/offline environments.
@Redias @Gh0stWires @Hexoplon I was able to get it working by setting an ENV variable named
TIKTOKEN_ENCODINGS_BASEpointing to the folder with the 2 encoding files.You do have to download both files before hand and put them in a directory on your host. The files are:
Related vllm-project/vllm#22525
Redias commentedon Aug 10, 2025
I download the vocab file in this method.
TIKTOKEN_RS_CACHE_DIR=/vocab/download/path python -c 'from openai_harmony import load_harmony_encoding; load_harmony_encoding("HarmonyGptOss")'ref: https://huggingface.co/openai/gpt-oss-120b/discussions/39#6892d6cc421a56a8deb417a7
StoKou commentedon Dec 4, 2025
so is there a solution for all?
Redias commentedon Dec 5, 2025
just use
TIKTOKEN_RS_CACHE_DIR=/vocab/download/path python -c 'from openai_harmony import load_harmony_encoding; load_harmony_encoding("HarmonyGptOss")'But there are some errors in your env and code. You can use an independent env to download the vocab file, and move it to where you want to use. Notify that move to
/tmp/tiktoken-rs-cache/, and the vocab filename is a hash-result.