Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(llm): add logos for the LM Studio and OpenAI-compatible cards
Elian Doran9e02f994e479
diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.spec.ts b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.spec.tsindex eb2a70ab21..1a0ccfbe41 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.spec.ts+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.spec.ts@@ -52,9 +52,11 @@ describe("AddProviderModal provider cards", () => {expect(byId.get("claude-agent")?.baseUrl).toBe("none");});- it("gives every card an icon of some kind", () => {+ it("gives every card a logo", () => {+ // SelectableCard is only passed `iconUrl`, so a card without one renders+ // with an empty icon slot rather than falling back to anything.for (const card of PROVIDER_TYPES) {- expect(card.iconUrl ?? card.icon, `no icon for ${card.id}`).toBeTruthy();+ expect(card.iconUrl, `no icon for ${card.id}`).toBeTruthy();}});});diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsxindex af24505fde..96fad46e7f 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx@@ -15,8 +15,10 @@ import SelectableCard, { SelectableCardGrid } from "../../../react/SelectableCarimport anthropicIcon from "./icons/anthropic.svg?url";import claudeAgentIcon from "./icons/claude-ai.svg?url";import geminiIcon from "./icons/gemini.svg?url";+import lmStudioIcon from "./icons/lmstudio.svg?url";import ollamaIcon from "./icons/ollama.svg?url";import openaiIcon from "./icons/openai.svg?url";+import openAiCompatibleIcon from "./icons/robot.svg?url";import ModelSelection from "./ModelSelection";export interface LlmProviderConfig {@@ -42,9 +44,7 @@ export interface ProviderType {*/prefillBaseUrl?: boolean;/** URL of the provider's logo (an imported `*.svg?url`), rendered monochrome via a CSS mask. */- iconUrl?: string;- /** Boxicons class shown when the provider has no logo of its own. */- icon?: string;+ iconUrl: string;/** Short blurb shown under the provider name on its selectable card. */description: string;/** One-line setup reminder shown under the endpoint field (i18n key, rendered via `<Trans>`). */@@ -81,12 +81,12 @@ export const PROVIDER_TYPES: ProviderType[] = [},{id: "lmstudio", name: "LM Studio", defaultBaseUrl: "http://localhost:1234/v1", prefillBaseUrl: true,- icon: "bx bx-desktop", description: t("llm.provider_desc_lmstudio"),+ iconUrl: lmStudioIcon, description: t("llm.provider_desc_lmstudio"),setupHintKey: "llm.setup_hint_lmstudio", apiKey: "none", baseUrl: "required"},{id: "openai-compatible", name: t("llm.provider_openai_compatible"), defaultBaseUrl: "http://localhost:8080/v1",- icon: "bx bx-server", description: t("llm.provider_desc_openai_compatible"),+ iconUrl: openAiCompatibleIcon, description: t("llm.provider_desc_openai_compatible"),setupHintKey: "llm.setup_hint_openai_compatible", apiKey: "optional", baseUrl: "required"}];diff --git a/apps/client/src/widgets/type_widgets/options/llm/icons/lmstudio.svg b/apps/client/src/widgets/type_widgets/options/llm/icons/lmstudio.svgnew file mode 100644index 0000000000..ea0816b63f--- /dev/null+++ b/apps/client/src/widgets/type_widgets/options/llm/icons/lmstudio.svg@@ -0,0 +1 @@+<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>\ No newline at end of filediff --git a/apps/client/src/widgets/type_widgets/options/llm/icons/ollama.svg b/apps/client/src/widgets/type_widgets/options/llm/icons/ollama.svgindex 432f73e738..2bdd5ef918 100644--- a/apps/client/src/widgets/type_widgets/options/llm/icons/ollama.svg+++ b/apps/client/src/widgets/type_widgets/options/llm/icons/ollama.svg@@ -1 +1 @@-<svg fill="#000000" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Ollama</title><path d="M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z"/></svg>\ No newline at end of file+<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24" transform="" id="injected-svg" xmlns="http://www.w3.org/2000/svg"><!--Boxicons v3.0.8 https://boxicons.com | License https://docs.boxicons.com/free--><path d="M7.73 2.01c-.19.03-.41.13-.57.25-.48.36-.85 1.13-1.01 2.1-.06.36-.1.87-.1 1.25 0 .45.05 1.03.13 1.43.02.09.03.17.02.17 0 0-.08.06-.16.13-.27.22-.58.55-.79.85a4.56 4.56 0 0 0-.78 1.95c-.04.28-.05.85-.02 1.13.08.65.27 1.2.61 1.7l.11.16-.03.05c-.22.38-.41.92-.5 1.44-.07.41-.08.52-.08 1.08s0 .67.07 1.06c.08.46.24.95.42 1.28.06.11.2.33.22.34 0 0-.01.06-.04.12a6.3 6.3 0 0 0-.46 1.56c-.05.35-.06.46-.06.83 0 .47.03.69.12 1.07v.05h1.24l-.04-.08c-.25-.46-.27-1.31-.06-2.16.1-.39.21-.68.41-1.08l.12-.24v-.15c0-.14 0-.15-.05-.24a.7.7 0 0 0-.16-.21c-.14-.13-.24-.28-.32-.45-.35-.77-.42-1.91-.17-2.88.1-.4.27-.77.45-.96.12-.13.19-.29.19-.44s-.06-.3-.19-.44c-.37-.4-.6-.88-.68-1.44-.12-.8.09-1.67.57-2.36.47-.68 1.13-1.11 1.87-1.23.17-.03.47-.02.65 0 .19.03.31.02.43-.03.15-.07.22-.16.31-.36.08-.18.14-.28.3-.48.2-.24.38-.41.68-.61.34-.23.74-.39 1.13-.47.14-.03.21-.03.47-.03s.33 0 .47.03c.57.12 1.14.41 1.6.83.1.09.33.38.41.5.03.05.08.15.11.22.09.2.16.29.31.36.12.06.24.07.42.04.29-.05.51-.04.79.01.95.19 1.78.98 2.15 2.03.32.92.23 1.89-.25 2.63-.08.12-.16.23-.28.35-.25.27-.25.6 0 .88.41.45.67 1.56.59 2.53-.05.64-.22 1.22-.44 1.55-.04.06-.12.16-.19.22-.08.08-.13.14-.16.21-.04.09-.05.11-.05.24v.15l.12.24c.21.4.32.69.41 1.08.21.84.19 1.68-.05 2.15l-.04.08h1.22l.02-.06s.02-.08.03-.11c.02-.06.05-.25.07-.43s.02-.85 0-1.05c-.09-.73-.25-1.31-.5-1.86a.4.4 0 0 1-.04-.12s.05-.06.09-.13c.31-.47.51-1.07.6-1.86.03-.22.03-1.15 0-1.36-.07-.54-.15-.9-.29-1.27-.06-.15-.21-.48-.27-.58l-.03-.05.11-.16c.33-.5.53-1.05.61-1.7.03-.28.02-.85-.02-1.13a4.56 4.56 0 0 0-.78-1.95 4.6 4.6 0 0 0-.95-.98s0-.08.02-.17c.17-.91.17-2.04-.01-2.92-.16-.77-.45-1.38-.82-1.73-.3-.28-.6-.4-.96-.38-.83.05-1.5 1-1.76 2.51-.04.24-.08.53-.08.6 0 .03 0 .05-.01.05s-.06-.03-.12-.06c-.64-.38-1.35-.58-2.05-.58s-1.41.2-2.05.58c-.06.04-.12.06-.12.06s-.01-.02-.01-.05c0-.08-.04-.37-.08-.6-.24-1.35-.79-2.25-1.52-2.47-.1-.03-.39-.05-.49-.03Zm.24 1.17c.21.16.44.63.57 1.16.02.09.05.2.06.24 0 .04.02.13.03.19.06.3.08.63.08 1.03v.39l-.1.15-.1.15h-.23c-.27 0-.54.03-.8.1-.09.02-.18.05-.2.05-.03 0-.03 0-.05-.12-.08-.64-.08-1.35.01-1.94.1-.66.34-1.25.58-1.43.06-.04.07-.04.13.01Zm8.19-.01c.14.1.3.38.41.74.23.71.3 1.69.18 2.62-.02.12-.02.13-.05.12-.02 0-.11-.03-.2-.05-.26-.07-.53-.1-.8-.1h-.23l-.1-.15-.1-.15v-.39c0-.56.06-.99.18-1.48.13-.52.36-.99.57-1.15.06-.05.07-.05.13-.01Z"></path><path d="M11.78 10.39c-.31.03-.4.04-.55.07-.24.05-.57.16-.79.27-.78.38-1.32 1.02-1.49 1.76-.03.15-.04.2-.04.44s0 .3.04.44c.22.97 1.11 1.68 2.26 1.81.25.03 1.33.03 1.58 0 .92-.1 1.72-.61 2.08-1.31.09-.19.14-.31.18-.5.03-.14.04-.19.04-.44s0-.3-.04-.44c-.24-1.07-1.28-1.92-2.56-2.08-.17-.02-.6-.04-.71-.03Zm.54.78c.43.05.86.2 1.2.43.19.12.45.38.56.55.14.21.22.42.25.68.02.12 0 .21-.04.4-.07.29-.28.59-.56.8-.13.1-.41.24-.57.29-.32.1-.53.12-1.27.11-.49 0-.57 0-.71-.03-.48-.09-.85-.28-1.12-.57-.22-.23-.32-.45-.38-.79-.02-.16.02-.42.11-.65.11-.27.41-.61.7-.8.34-.22.78-.38 1.18-.43.16-.02.49-.02.64 0Z"></path><path d="M11.45 12.22c-.11.06-.19.21-.16.32.03.12.13.24.29.34.09.05.09.06.1.11 0 .03 0 .12-.02.2a1 1 0 0 0-.03.19c0 .06.06.16.12.21.05.04.06.04.21.05.14 0 .17 0 .22-.02.14-.07.18-.2.12-.44-.04-.2-.03-.23.07-.3.11-.07.23-.18.27-.26.07-.15 0-.32-.15-.4a.3.3 0 0 0-.15-.03c-.1 0-.17.02-.3.1l-.07.04-.04-.03c-.18-.11-.22-.12-.33-.12-.08 0-.12 0-.16.03Zm-3.49-1.67a.86.86 0 0 0-.54.53c-.05.13-.07.33-.05.43.05.26.26.49.5.56.3.08.53.03.73-.17a.85.85 0 0 0 .24-.37c.05-.11.05-.13.05-.29v-.17l-.06-.12c-.1-.2-.27-.34-.47-.39a.86.86 0 0 0-.39 0Zm7.67 0c-.2.05-.37.2-.47.39l-.06.12v.17c0 .16 0 .18.05.29.06.16.13.26.24.37.2.2.43.25.73.17.17-.05.35-.19.43-.36.07-.15.09-.25.07-.41-.05-.38-.27-.65-.6-.75a.86.86 0 0 0-.39 0Z"></path></svg>\ No newline at end of filediff --git a/apps/client/src/widgets/type_widgets/options/llm/icons/robot.svg b/apps/client/src/widgets/type_widgets/options/llm/icons/robot.svgnew file mode 100644index 0000000000..fe8d50611c--- /dev/null+++ b/apps/client/src/widgets/type_widgets/options/llm/icons/robot.svg@@ -0,0 +1 @@+<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24" transform="" id="injected-svg" xmlns="http://www.w3.org/2000/svg"><!--Boxicons v3.0.8 https://boxicons.com | License https://docs.boxicons.com/free--><path d="M8.5 10a1.5 2 0 1 0 0 4 1.5 2 0 1 0 0-4m7 0a1.5 2 0 1 0 0 4 1.5 2 0 1 0 0-4M8 16h8v2H8z"></path><path d="M21 11V8c0-1.1-.9-2-2-2h-6V4.61c.3-.27.5-.67.5-1.11 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .44.2.84.5 1.11V6H5c-1.1 0-2 .9-2 2v3c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1M5 20V8h14v12z"></path></svg>\ No newline at end of file