2024-03-04 13:22:45 +07:00

2.5 KiB

title description keywords
Threads Jan is a ChatGPT-alternative that runs on your own computer, with a local API server.
Jan AI
Jan
ChatGPT alternative
local AI
private AI
conversational AI
no-subscription fee
large language model

:::caution

This is currently under development.

:::

Overview

Threads are conversations between an assistant and the user:

  • Users can tweak model params and assistant behavior within each thread.
  • Users can import and export threads.
  • An OpenAI Thread API compatible endpoint at localhost:1337/v1/threads.

Folder Structure

  • Threads are saved in the /threads folder.
  • Threads are organized by folders, one for each thread, and can be easily zipped, exported, and cleared.
  • Thread folders follow the naming: assistant_id + thread_created_at.
  • Thread folders also contain messages.jsonl files. See messages.
janroot/
    threads/
        assistant_name_unix_timestamp/    # Thread `ID`
            thread.json

thread.json

  • Each thread folder contains a thread.json file, which is a representation of a thread.
  • thread.json contains metadata and model parameter overrides.
  • There are no required fields.

Example

Here's a standard example thread.json for a conversation between the user and the default Jan assistant.

"id": "thread_....",                  // Defaults to foldername
"object": "thread",                   // Defaults to "thread"
"title": "funny physics joke",        // Defaults to ""
"assistants": [
  {
    "assistant_id": "jan",            // Defaults to "jan"
    "model": {                        // Defaults to the currently active model (can be changed before thread is begun)
      "id": "...",
      "settings": {},                 // Defaults to and overrides assistant.json's "settings" (and if none, then model.json "settings")
      "parameters": {},               // Defaults to and overrides assistant.json's "parameters" (and if none, then model.json "parameters")
    }
  },
],
"created": 1231231                    // Defaults to file creation time
"metadata": {},                       // Defaults to {}

API Reference

Jan's Threads API is compatible with OpenAI's Threads API, with additional methods for managing threads locally.

See Jan Threads API.