LmCast :: Stay tuned in

Show HN: Compile-time model-id validation with declared capability

Recorded: May 29, 2026, 12:02 p.m.

Original Summarized

GitHub - yujonglee/openrouter-toolkit · GitHub

Skip to content

Navigation Menu

Toggle navigation

Sign in

Appearance settings

PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing

Search or jump to...

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Provide feedback


We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

yujonglee

/

openrouter-toolkit

Public

Notifications
You must be signed in to change notification settings

Fork
0

Star
0

Code

Issues
0

Pull requests
1

Actions

Projects

Security and quality
0

Insights

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Security and quality

Insights


yujonglee/openrouter-toolkit

 mainBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History9 Commits9 Commits.github/workflows.github/workflows  cratescrates  srcsrc  teststests  .gitignore.gitignore  .oxfmtrc.json.oxfmtrc.json  Cargo.lockCargo.lock  Cargo.tomlCargo.toml  README.mdREADME.md  package.jsonpackage.json  pnpm-lock.yamlpnpm-lock.yaml  rust-toolchain.tomlrust-toolchain.toml  View all filesRepository files navigationREADMEopenrouter-toolkit
Compile-time checked OpenRouter model ids.
model_supports! validates a model id and its required capabilities against a vendored OpenRouter index, then expands to the model id string.
use openrouter_toolkit::model_supports;

const MODEL: &str = model_supports!(
"openai/gpt-5.4",
param::tools,
input::image,
output::text,
);
Dynamic variants work too:
const MODEL: &str = model_supports!("moonshotai/kimi-k2-0905:exacto", param::tools);
Capabilities

param::* — request parameters (e.g. param::tools)
input::* — input modalities (e.g. input::image)
output::* — output modalities (e.g. output::text)

Errors at compile time
Unknown capability:
const MODEL: &str = model_supports!("qwen/qwen3.7-max", param::toolz);
error: unknown OpenRouter capability `param::toolz`; did you mean `param::tools`?

Capability not supported by the model:
const MODEL: &str = model_supports!("qwen/qwen3.7-max", input::image);
error: OpenRouter model `qwen/qwen3.7-max` does not support required capability(s): input::image

About

No description, website, or topics provided.

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.


Activity
Stars

0
stars
Watchers

0
watching
Forks

0
forks

Report repository

Releases
No releases published

Packages
0

 

 

 

Uh oh!

There was an error while loading. Please reload this page.


Contributors

Uh oh!

There was an error while loading. Please reload this page.


Languages

Rust
100.0%

Footer

© 2026 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Community

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.

The openrouter-toolkit is a project implemented primarily in Rust, designed to validate and manage the supported capabilities of various AI models indexed via the OpenRouter platform. The core functionality revolves around a mechanism, specifically the model_supports function, which validates a given model identifier against a vendored OpenRouter index to determine if it supports a specific set of required and desired model capabilities.

The system models capabilities using structured parameters. Input modalities, such as input::image, and output modalities, such as output::text, are defined to specify the types of data the model can process or generate. Request parameters, like param::tools, are used to specify functional capabilities. The toolkit determines the compatibility of a model by cross-referencing its advertised capabilities against the requirements specified by the user.

The validation process is designed to occur at compile time, ensuring that model configurations are sensible before runtime execution. The system manages this validation by checking for the presence of requested capabilities. For instance, the toolkit allows users to define a configuration for a model, such as requiring tool usage, input image processing, or text output.

The system exhibits compile-time error handling for invalid configurations. If a requested capability, such as param::toolz, is unknown within the OpenRouter index, the compiler will immediately flag an error, suggesting alternative valid options, preventing the creation of logically inconsistent model definitions. Furthermore, the system enforces explicit support requirements; if a model, such as qwen/qwen3.7-max, is determined not to support a requested modality, such as input::image, the compilation fails with an error indicating that the model lacks the required capability.

The toolkit supports both static and dynamic model referencing. It can validate known model IDs directly, such as openai/gpt-5.4, or dynamically constructed identifiers incorporating specific model tags, such as moonshotai/kimi-k2-0905:exacto. This dynamic approach allows the toolkit to adapt its validation logic across a diverse set of AI providers indexed by OpenRouter.

In essence, the openrouter-toolkit provides a robust framework for interacting with and verifying the operational constraints of large language models by formalizing their supported input, output, and functional capabilities against a centralized index. This mechanism enforces a contract between the desired application requirements and the actual model specifications, thereby enhancing the reliability of AI-powered workflows.