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 Include my email address so I can be contacted Cancel Submit feedback Saved searches
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. Dismiss alert yujonglee openrouter-toolkit Public
Notifications
Fork
Star Code Issues Pull requests Actions Projects Security and quality Insights
Additional navigation options
Code Issues Pull requests Actions Projects Security and quality Insights
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 const MODEL: &str = model_supports!( param::* — request parameters (e.g. param::tools) Errors at compile time Capability not supported by the model: About No description, website, or topics provided. Readme Uh oh! There was an error while loading. Please reload this page. Activity 0 0 0 Report repository Releases Packages
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
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. |