Miscellaneous tech notes

Import Open WebUI conversations into LibreChat

  1. In Open WebUI, download your chats (Your nameChatsExport Chats)
  2. Using jq, run the following command against the chat-export-*.json file:
jq '[.[] | {
  title: .title,
  create_time: .created_at,
  update_time: .updated_at,
  mapping: (.chat.history.messages | to_entries | map({
    key: .value.id,
    value: {
      id: .value.id,
      message: {
        id: .value.id,
        author: {
          role: .value.role,
          name: null,
          metadata: {}
        },
        create_time: (.value.timestamp | tostring),
        update_time: null,
        content: {
          content_type: "text",
          parts: [.value.content]
        },
        status: "finished_successfully",
        end_turn: true,
        weight: 1.0,
        metadata: {},
        recipient: "all",
        channel: null
      },
      parent: .value.parentId,
      children: (.value.childrenIds // [])
    }
  }) | from_entries),
  moderation_results: [],
  current_node: .chat.currentId,
  conversation_id: .id,
  id: .id
}]' chat-export-*.json > converted.json
  1. In LibreChat, click your name and visit SettingsData controlsImport, and upload converted.json.