Get Related Topics using Cloudflare Workers AI free tier

Overview

Currently we offer Related Topics to all customers hosted by Discourse. For those that are self-hosted they would require getting there own Embeddings set up, which power Related topics.

In this guide we will be exploring how to get Related Topics for free using Cloudflare Workers AI.

Pre-requisites

In order for this to work you will need the following

Additionally, the following guides can be referenced

Configuration

  1. Once Discourse AI is enabled, you would need to enable Related Topics on your Discourse instance
  1. Follow API Keys for Cloudflare Workers AI to get a working key inputted
  1. Configure the plugin to respect Cloudflare Workers AI free tier rate limits:
cd /var/discourse
./launcher enter app
rails c
SiteSetting.ai_embeddings_backfill_batch_size = 20
exit
exit
exit

Caveats

3 Likes