This repository was archived by the owner on Jul 22, 2025. It is now read-only.
  
  
  
            
  
    
      generated from discourse/discourse-plugin-skeleton
    
        
        - 
                Notifications
    You must be signed in to change notification settings 
- Fork 41
FEATURE: configure a default LLM model for all features #1496
          
     Closed
      
      
    Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    This update adds a setting to the configure a default LLM model to be used for all features (unless overridden).
- no need for seeding checks or module dependant checks
It resets it to default before the migration
              
                    romanrizzi
  
              
              suggested changes
              
                  
                    Jul 15, 2025 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do ai_translation_model too?
        
          
                db/migrate/20250710181656_copy_ai_helper_model_to_persona_default.rb
              
                Outdated
          
            Show resolved
            Hide resolved
        
      and update migrations for translations
              
                    romanrizzi
  
              
              suggested changes
              
                  
                    Jul 18, 2025 
                  
              
              
            
            
        
          
                db/migrate/20250710180401_copy_ai_summarization_model_to_persona_default.rb
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                db/migrate/20250710181656_copy_ai_helper_model_to_persona_default.rb
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                db/migrate/20250716005855_copy_ai_image_caption_model_to_persona_default.rb
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                lib/translation.rb
              
                Outdated
          
        
      | def self.enabled? | ||
| SiteSetting.discourse_ai_enabled && SiteSetting.ai_translation_enabled && | ||
| SiteSetting.ai_translation_model.present? && | ||
| SiteSetting.ai_default_llm_model.present? && | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check if the persona has an LLM set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which one 😅
  ai_translation_locale_detector_persona:
    default: "-27"
    type: enum
    enum: "DiscourseAi::Configuration::PersonaEnumerator"
    area: "ai-features/translation"
  ai_translation_post_raw_translator_persona:
    default: "-28"
    type: enum
    enum: "DiscourseAi::Configuration::PersonaEnumerator"
    area: "ai-features/translation"
  ai_translation_topic_title_translator_persona:
    default: "-29"
    type: enum
    enum: "DiscourseAi::Configuration::PersonaEnumerator"
    area: "ai-features/translation"
  ai_translation_short_text_translator_persona:
    default: "-30"
    type: enum
    enum: "DiscourseAi::Configuration::PersonaEnumerator"
    area: "ai-features/translation"I suppose all of them must have a default_llm_id OR SiteSetting.ai_default_llm_model needs to be present?
              
                    romanrizzi
  
              
              reviewed
              
                  
                    Jul 21, 2025 
                  
              
              
            
            
        
          
                db/migrate/20250716005855_copy_ai_image_caption_model_to_persona_default.rb
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | Plugin moving to core. This will need to be re-opened against discourse/discourse. Sorry @keegangeorge | 
  
      Sign up for free
      to subscribe to this conversation on GitHub.
      Already have an account?
      Sign in.
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
🔍 Overview
This update adds a setting to the configure a default LLM model to be used for all features (unless overridden) and removes the
custom:prefix when defining LLM models➕ More information
For all features, the feature's assigned AI Persona's
default_llm_idwill be used, however, if it doesn't exist, theSiteSetting.ai_default_llm_modelwill be used instead.This update also adds a few migrations which migrates the old model settings for Helper and Summarization into their respective personas. That is:
SiteSetting.ai_helper_model's existing value on sites will be copied into:SiteSetting.ai_summarization_model's existing value on sites will be copied intoEventually, we will follow-up in a separate commit to remove the following settings:
By default
SiteSetting.ai_default_llm_modelwill havedefault: ""in it'syamlfile, however, this update also adds a migration which will ensure that the last created LLM model is used to fill the setting.📸 Screenshots