Skip to content

Expose all free OpenRouter models#92

Merged
chrarnoldus merged 11 commits intomainfrom
remove-isRateLimitedToDeathFree
Feb 10, 2026
Merged

Expose all free OpenRouter models#92
chrarnoldus merged 11 commits intomainfrom
remove-isRateLimitedToDeathFree

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Feb 10, 2026

Summary

Remove the isRateLimitedToDeathFree function from the codebase since :free models are now always allowed.

Changes

  • Remove function definition from src/lib/providers/openrouter/index.ts
  • Remove filter condition using isRateLimitedToDeathFree in enhancedModelList
  • Remove import and filter condition in sync-providers.ts
  • Remove import and check in openrouter route.ts

Context

:free models are now always allowed because:

  • isFreeModel returns true for :free models
  • isDataCollectionRequiredOnKiloCodeOnly returns false for :free models

Built for Christiaan by Kilo for Slack

- Remove function definition from src/lib/providers/openrouter/index.ts
- Remove filter condition using isRateLimitedToDeathFree in enhancedModelList
- Remove import and filter condition in sync-providers.ts
- Remove import and check in openrouter route.ts

:free models are now always allowed since:
- isFreeModel returns true for :free models
- isDataCollectionRequiredOnKiloCodeOnly returns false for :free models
Comment thread src/app/api/openrouter/[...path]/route.ts
Comment thread src/lib/providers/openrouter/index.ts
Comment thread src/lib/providers/openrouter/sync-providers.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Feb 10, 2026

Code Review Summary

Status: 10 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 7
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
src/app/api/openrouter/[...path]/route.ts 243 Removing isRateLimitedToDeathFree changes handling of OpenRouter :free variants (policy mismatch risk)
src/lib/providers/openrouter/index.ts 59 getEnhancedOpenRouterModels() now exposes OpenRouter :free models to users (curation/policy mismatch risk)
src/lib/providers/openrouter/sync-providers.ts N/A Provider sync now keeps upstream :free variants (previously excluded)
src/lib/models.ts N/A isFreeModel() now treats any :free suffix as a free model (broadens anon access + free-model rate limiting behavior)
src/lib/models.ts 33 isFreeModel() treats invalid IDs like :free / leading-whitespace variants as free
src/lib/models.ts 39 isFreeModel() vs isDataCollectionRequiredOnKiloCodeOnly() now diverge for :free models, so data-collection gating may not match free-model policy
src/lib/providers/recommended-models.ts 48 recommendedModels still includes arcee-ai/trinity-large-preview:free after removing kiloFreeModels provider entry; verify intended free-model selection behavior

SUGGESTION

File Line Issue
src/lib/model-utils.ts 10 normalizeModelId() strips everything after the first :; consider lastIndexOf(':') if only removing the final suffix segment
src/lib/providers/openrouter/index.ts N/A Free labeling via parseFloat(model.pricing.prompt) === 0 may misclassify if pricing strings are missing/non-numeric
src/lib/providers/openrouter/index.ts 72 Free/new labeling is skipped for any model name ending with ) (e.g. Foo (preview) never gets (free)/(new))
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

None.

Files Reviewed (11 files)
  • src/app/api/openrouter/[...path]/route.ts - 1 issue
  • src/lib/model-utils.ts - 1 issue
  • src/lib/models.ts - 3 issues
  • src/lib/models.test.ts - 0 issues
  • src/lib/providers/openrouter/index.ts - 3 issues
  • src/lib/providers/openrouter/sync-providers.ts - 2 issues
  • src/lib/providers/recommended-models.ts - 1 issue
  • src/lib/providers/mistral.ts - 0 issues
  • src/lib/providers/openrouter/openrouter-types.ts - 0 issues
  • src/tests/openrouter-models-sorting.approved.json - 0 issues
  • src/data/openrouter-models-by-provider-backup.json - 0 issues

Fix these issues in Kilo Cloud

Comment thread src/lib/models.ts Outdated
Comment thread src/lib/providers/openrouter/sync-providers.ts
Comment thread src/lib/models.ts
Comment thread src/lib/providers/openrouter/index.ts Outdated
@chrarnoldus
Copy link
Copy Markdown
Contributor

My reasoning for this change is:

  • Not all of these models have prohibitive rate limits anymore
  • Users can already circumvent it by using openrouter/free
  • The current process of adding free models is confusing

Comment thread src/lib/model-utils.ts
Comment thread src/lib/models.ts
Comment thread src/lib/providers/openrouter/index.ts
Copy link
Copy Markdown
Contributor

@markijbema markijbema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

does feel like we then want to filter out ones later because we get tons of complains of them not working

@chrarnoldus chrarnoldus changed the title Remove isRateLimitedToDeathFree function Expose all free OpenRouter models Feb 10, 2026
return modelDoesNotExistResponse();
}

if (isRateLimitedToDeathFree(originalModelIdLowerCased)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What did this used to be for?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to prevent people from manually modifying model ids to end in :free

Comment thread src/lib/models.ts
export const preferredModels = recommendedModels.map(m => m.public_id);

const freeOpenRouterModels = [
'openrouter/aurora-alpha',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look a lot cleaner and easier to manage. I imagine the need for this is models that don't end in :free but are indeed free?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, otherwise they would require a positive balance to be used (but would still be free)

@chrarnoldus chrarnoldus merged commit bacc235 into main Feb 10, 2026
12 checks passed
@chrarnoldus chrarnoldus deleted the remove-isRateLimitedToDeathFree branch February 10, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants