Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/data/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ function modelJsonUrl(siteUrl: string, model: Model): string {
}

function modelTitle(model: Model): string {
return `${providerLabel(model.provider)} ${modelLabel(model)} (${authLabel(model.authType)})`;
const variant = model.authType === "subscription" ? ` (${authLabel(model.authType)})` : "";
return `${providerLabel(model.provider)} ${modelLabel(model)}${variant}`;
}

function plural(n: number, word: string): string {
Expand Down
9 changes: 3 additions & 6 deletions src/views/model.ejs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<%
const providerLogo = helpers.logoFor(model.provider);
const authName = helpers.authLabel(model.authType);
const authClasses =
model.authType === "api_key"
? "bg-indigo-100 text-indigo-800 dark:bg-indigo-900/50 dark:text-indigo-200"
: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200";
%>
<%- include("partials/breadcrumbs", { items: [
{ name: "Home", href: "/" },
Expand All @@ -20,7 +15,9 @@
<% } %>
<span><%= providerName %></span>
</span>
<span class="inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium <%= authClasses %>"><%= authName %></span>
<% if (isSubscription) { %>
<span class="inline-flex shrink-0 items-center rounded-md bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200"><%= helpers.authLabel(model.authType) %></span>
<% } %>
<span class="text-xs tabular-nums text-slate-500 dark:text-slate-400"><%= model.params.length %> param<%= model.params.length === 1 ? "" : "s" %></span>
</div>
<h1 class="mt-3 text-balance text-2xl font-bold tracking-tight sm:text-3xl">
Expand Down
12 changes: 5 additions & 7 deletions src/views/partials/model_row.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
const id = helpers.modelId(model);
const providerName = helpers.providerLabel(model.provider);
const modelName = helpers.modelLabel(model);
const authName = helpers.authLabel(model.authType);
const authClasses =
model.authType === "api_key"
? "bg-indigo-100 text-indigo-800 dark:bg-indigo-900/50 dark:text-indigo-200"
: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200";
const isSubscription = model.authType === "subscription";
const capabilities = model.params.map((p) => p.path).join(" ");
const providerLogo = helpers.logoFor(model.provider);
%>
Expand Down Expand Up @@ -36,9 +32,11 @@
data-model-link
class="flex-1 truncate text-sm font-semibold hover:text-accent sm:text-base dark:hover:text-accent"
><%= modelName %></a>
<span class="inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium <%= authClasses %>"
><%= authName %></span
<% if (isSubscription) { %>
<span class="inline-flex shrink-0 items-center rounded-md bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200"
><%= helpers.authLabel(model.authType) %></span
>
<% } %>
<span class="shrink-0 text-xs tabular-nums text-slate-500 dark:text-slate-400"
><%= model.params.length %> param<%= model.params.length === 1 ? "" : "s" %></span
>
Expand Down
11 changes: 3 additions & 8 deletions src/views/provider.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,15 @@
<section class="mt-8" aria-label="<%= providerName %> models">
<ul class="grid grid-cols-1 gap-2 sm:grid-cols-2">
<% for (const model of models) { %>
<%
const authName = helpers.authLabel(model.authType);
const authClasses =
model.authType === "api_key"
? "bg-indigo-100 text-indigo-800 dark:bg-indigo-900/50 dark:text-indigo-200"
: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200";
%>
<li>
<a
href="<%= helpers.modelPagePath(model) %>"
class="flex items-center gap-3 rounded-xl border border-slate-200 bg-white px-4 py-3 shadow-sm transition-colors hover:border-slate-300 dark:border-slate-800 dark:bg-slate-900 dark:hover:border-slate-700"
>
<span class="flex-1 truncate text-sm font-semibold sm:text-base"><%= helpers.modelLabel(model) %></span>
<span class="inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium <%= authClasses %>"><%= authName %></span>
<% if (model.authType === "subscription") { %>
<span class="inline-flex shrink-0 items-center rounded-md bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200"><%= helpers.authLabel(model.authType) %></span>
<% } %>
<span class="shrink-0 text-xs tabular-nums text-slate-500 dark:text-slate-400"><%= model.params.length %> param<%= model.params.length === 1 ? "" : "s" %></span>
<svg class="h-4 w-4 shrink-0 text-slate-300 dark:text-slate-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 0 1 .02-1.06L11.085 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z" clip-rule="evenodd" />
Expand Down
Loading