discourse/plugins/discourse-ai
Keegan George 902fd7494b
FEATURE: Hosted LLM credit system (#35162)
## 🔍 Overview
This update adds a credit system under the hood which will be used for
our CDCK Hosted LLM models so we can make our features more accessible
to our hosted customers!

## 📷 Screenshots
<img width="1105" height="268" alt="Screenshot 2025-10-02 at 12 48 58"
src="https://github.com/user-attachments/assets/2a07d89b-7510-4565-82bb-26b46fbcf5c4"
/>

_☝🏽 ` ProblemCheck` notices to inform customers_

<img width="1077" height="472" alt="Screenshot 2025-10-02 at 12 49 41"
src="https://github.com/user-attachments/assets/b72028f7-5df2-45a8-8c71-65cf750755ab"
/>

_☝🏽 AI Usage page for easy monitoring_

<img width="1112" height="1083" alt="Screenshot 2025-10-02 at 18 17 01"
src="https://github.com/user-attachments/assets/a01992d5-15a0-472a-9501-bc3bc9a54ade"
/>

_☝🏽 Credit bars underneath relevant LLM models_

<img width="866" height="267" alt="Screenshot 2025-10-03 at 11 35 19"
src="https://github.com/user-attachments/assets/e7b4c0e7-c93d-4b0f-923d-79ac5d53028b"
/>

_☝🏽 Dialog box when trying to use without available credits_
2025-10-14 07:48:20 -07:00
..
admin/assets/javascripts/discourse DEV: Remove unused service injections (#34750) 2025-10-08 13:31:41 +02:00
app FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
assets FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
config FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
db FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
discourse_automation FIX: allow AI tagging automation to tag posts by bots (#35310) 2025-10-09 18:45:43 -04:00
evals DEV: Switch AI debug messages to off by default (#35320) 2025-10-10 21:47:36 +08:00
lib FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
public/ai-share
spec FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
svg-icons
test/javascripts FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
.prettierignore
about.json
plugin.rb FEATURE: Hosted LLM credit system (#35162) 2025-10-14 07:48:20 -07:00
README.md

Discourse AI Plugin

Plugin Summary

For more information, please see: https://meta.discourse.org/t/discourse-ai/259214?u=falco

Evals

The directory evals contains AI evals for the Discourse AI plugin. You may create a local config by copying config/eval-llms.yml to config/eval-llms.local.yml and modifying the values.

To run them use:

cd evals ./run --help

Usage: evals/run [options]
    -e, --eval NAME                  Name of the evaluation to run
        --list-models                List models
    -m, --model NAME                 Model to evaluate (will eval all models if not specified)
    -l, --list                       List evals

To run evals you will need to configure API keys in your environment:

OPENAI_API_KEY=your_openai_api_key ANTHROPIC_API_KEY=your_anthropic_api_key GEMINI_API_KEY=your_gemini_api_key