diff --git a/assets/javascripts/discourse/components/ai-llms-list-editor.gjs b/assets/javascripts/discourse/components/ai-llms-list-editor.gjs
index 0bc82d68..2fec3d45 100644
--- a/assets/javascripts/discourse/components/ai-llms-list-editor.gjs
+++ b/assets/javascripts/discourse/components/ai-llms-list-editor.gjs
@@ -1,16 +1,23 @@
import Component from "@glimmer/component";
import { concat, fn } from "@ember/helper";
import { action } from "@ember/object";
-import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
+import DButton from "discourse/components/d-button";
import DPageSubheader from "discourse/components/d-page-subheader";
import i18n from "discourse-common/helpers/i18n";
import I18n from "discourse-i18n";
import AdminSectionLandingItem from "admin/components/admin-section-landing-item";
import AdminSectionLandingWrapper from "admin/components/admin-section-landing-wrapper";
+import DTooltip from "float-kit/components/d-tooltip";
import AiLlmEditor from "./ai-llm-editor";
+function isPreseeded(llm) {
+ if (llm.id < 0) {
+ return true;
+ }
+}
+
export default class AiLlmsListEditor extends Component {
@service adminPluginNavManager;
@service router;
@@ -36,6 +43,15 @@ export default class AiLlmsListEditor extends Component {
return "";
}
+ @action
+ preseededDescription(llm) {
+ if (isPreseeded(llm)) {
+ return i18n("discourse_ai.llms.preseeded_model_description", {
+ model: llm.name,
+ });
+ }
+ }
+
sanitizedTranslationKey(id) {
return id.replace(/\./g, "-");
}
@@ -146,6 +162,7 @@ export default class AiLlmsListEditor extends Component {
class="ai-llm-list__row d-admin-row__content"
>
+
{{llm.display_name}}
@@ -153,6 +170,7 @@ export default class AiLlmsListEditor extends Component {
{{this.modelDescription llm}}
+ {{this.preseededDescription llm}}
{{#if llm.used_by}}
@@ -171,15 +189,26 @@ export default class AiLlmsListEditor extends Component {
}}
|
-
-
- {{i18n "discourse_ai.llms.edit"}}
-
-
+ {{#if (isPreseeded llm)}}
+
+ <:trigger>
+
+
+ <:content>
+ {{i18n "discourse_ai.llms.seeded_warning"}}
+
+
+ {{else}}
+
+ {{/if}}
|
{{/each}}
diff --git a/assets/stylesheets/modules/llms/common/ai-llms-editor.scss b/assets/stylesheets/modules/llms/common/ai-llms-editor.scss
index 49ce51ff..5f62a47a 100644
--- a/assets/stylesheets/modules/llms/common/ai-llms-editor.scss
+++ b/assets/stylesheets/modules/llms/common/ai-llms-editor.scss
@@ -87,16 +87,18 @@
tr:hover {
background: inherit;
}
- th,
- td {
- &:first-child {
- padding-left: 0;
+ @include breakpoint("tablet", min-width) {
+ th,
+ td {
+ &:first-child {
+ padding-left: 0;
+ }
}
- }
- th,
- td {
- &:last-child {
- padding-right: 0;
+ th,
+ td {
+ &:last-child {
+ padding-right: 0;
+ }
}
}
}
@@ -158,3 +160,14 @@
margin-right: 0.5em;
}
}
+
+.ai-llm-list__seeded-model {
+ color: var(--primary-high);
+ font-size: var(--font-down-1);
+}
+
+@include breakpoint("tablet") {
+ .ai-llm-list__description {
+ max-width: 80%;
+ }
+}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 14c9db6b..bd5a2c9e 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -365,6 +365,8 @@ en:
mistral-mistral-large-latest: "Mistral's most powerful model"
mistral-pixtral-large-latest: "Mistral's most powerful vision capable model"
+ preseeded_model_description: "Pre-configured open-source model utilizing %{model}"
+
configured:
title: "Configured LLMs"
preconfigured_llms: "Select your LLM"
diff --git a/spec/system/llms/ai_llm_spec.rb b/spec/system/llms/ai_llm_spec.rb
index 649f5d9b..76ee8cae 100644
--- a/spec/system/llms/ai_llm_spec.rb
+++ b/spec/system/llms/ai_llm_spec.rb
@@ -84,21 +84,20 @@ RSpec.describe "Managing LLM configurations", type: :system, js: true do
)
end
- it "shows an info alert to the user about the seeded LLM" do
+ it "seeded LLM has a description" do
visit "/admin/plugins/discourse-ai/ai-llms"
- find("[data-llm-id='#{llm_model.name}'] .ai-llm-list__edit-button").click()
+
+ desc = I18n.t("js.discourse_ai.llms.preseeded_model_description", model: llm_model.name)
+
expect(page).to have_css(
- ".alert.alert-info",
- text: I18n.t("js.discourse_ai.llms.seeded_warning"),
+ "[data-llm-id='#{llm_model.name}'] .ai-llm-list__description",
+ text: desc,
)
end
- it "limits and shows disabled inputs for the seeded LLM" do
+ it "seeded LLM has a disabled edit button" do
visit "/admin/plugins/discourse-ai/ai-llms"
- find("[data-llm-id='cdck-hosted'] .ai-llm-list__edit-button").click()
- expect(page).to have_css(".ai-llm-editor__display-name[disabled]")
- expect(page).to have_css(".ai-llm-editor__name[disabled]")
- expect(page).to have_css(".ai-llm-editor__provider.is-disabled")
+ expect(page).to have_css("[data-llm-id='cdck-hosted'] .ai-llm-list__edit-disabled-tooltip")
end
end
end