Skip to content

Tiny script to import existing ChatGPT conversations to Jan.ai

License

Notifications You must be signed in to change notification settings

timonrieger/janai-chatgpt-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jan.ai ChatGPT Importer

This is a tiny script to import existing ChatGPT conversations from your OpenAI account to Jan.ai.

What is 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.

The Script

Expectations

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.

What Data is Being Transferred?

  • 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)

How to Use

  1. Export your data from ChatGPT (Docs).
  2. Move the downloaded data folder to a reachable path on your disk.
  3. Locate the conversations.json file in the first folder level and copy its absolute pathname.
  4. In main.py, replace CHATGPT_CONVERSATIONS_JSON with the path.
  5. Download Jan for desktop.
  6. Open Jan and navigate to Settings > Advanced Settings > Jan Data Folder.
  7. Copy the absolute pathname to the threads folder (usually Jan/Data/threads).
  8. In main.py, replace JAN_THREAD_FOLDER with the path.
  9. Ensure CHATGPT_CONVERSATIONS_JSON ends with conversations.json and JAN_THREAD_FOLDER ends with /threads.
  10. Run the script:
    python3 -m main
  11. 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.

License

This script is licensed under the MIT License. See the LICENSE file for details.

About

Tiny script to import existing ChatGPT conversations to Jan.ai

Topics

Resources

License

Stars

Watchers

Forks

Languages