mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-25 23:46:51 +00:00
fix(ai-chat): drop redundant "(free)" suffix from OpenRouter model names
OpenRouter appends "(free)" to the display name of its free-tier model variants (e.g. "Liquid AI: LFM2.5-2.6B (free)"). The ":free" model id already conveys this, so the suffix is redundant in the human-facing name shown across Puter and the developer docs. Strip a trailing "(free)" from the coerced display name while keeping the original name as an alias so existing references still resolve. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018q5AWeB6pvt3LPHYxknis6
This commit is contained in:
@@ -268,12 +268,17 @@ export class OpenRouterProvider implements IChatProvider {
|
||||
if (!microcentCosts.request) {
|
||||
microcentCosts.request = 0;
|
||||
}
|
||||
// OpenRouter appends "(free)" to the display name of its free-tier
|
||||
// model variants. The ":free" model id already conveys that, so
|
||||
// drop the redundant suffix from the human-facing name.
|
||||
const displayName = model.name.replace(/\s*\(free\)\s*$/i, '');
|
||||
coerced_models.push({
|
||||
id: `openrouter:${model.id}`,
|
||||
name: `${model.name} (OpenRouter)`,
|
||||
name: `${displayName} (OpenRouter)`,
|
||||
aliases: [
|
||||
model.id,
|
||||
model.name,
|
||||
displayName,
|
||||
`openrouter/${model.id}`,
|
||||
model.id.split('/').slice(1).join('/'),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user