This is a tiny script to import existing ChatGPT conversations from your OpenAI account to Jan.ai.
Jan.ai is an open-source ChatGPT alternative that runs completely offline on your computer. While ChatGPT communicates with servers on request, Jan uses a locally downloaded model. You can download any GGUF model from Huggingface or use one from Jan's model hub.
This script was developed in one or two hours, so it lacks error handling or polish. It simply maps the JSON format provided by ChatGPT to the one required by Jan. These formats could change at any time by either party.
- All conversations
- Metadata such as creation date, update date, conversation title, and author
- Duplicates are ignored because the entire ChatGPT history is overwritten during import, including new messages in ongoing conversations. Existing Jan.ai conversations remain untouched.
- No attachments (not important to me but could be added)
- Export your data from ChatGPT (Docs).
- Move the downloaded data folder to a reachable path on your disk.
- Locate the
conversations.json
file in the first folder level and copy its absolute pathname. - In
main.py
, replaceCHATGPT_CONVERSATIONS_JSON
with the path. - Download Jan for desktop.
- Open Jan and navigate to
Settings
>Advanced Settings
>Jan Data Folder
. - Copy the absolute pathname to the
threads
folder (usuallyJan/Data/threads
). - In
main.py
, replaceJAN_THREAD_FOLDER
with the path. - Ensure
CHATGPT_CONVERSATIONS_JSON
ends withconversations.json
andJAN_THREAD_FOLDER
ends with/threads
. - Run the script:
python3 -m main
- When restarting Jan, you should see all imported chats. Note: As of now, Jan sorts chats by folder order rather than by date. This generally works fine for imported chats but might disrupt the order of existing chats started in Jan.
This script is licensed under the MIT License. See the LICENSE file for details.