-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestFor Hacktoberfest Participants!For Hacktoberfest Participants!help wantedExtra attention is neededExtra attention is neededup-for-grabs
Description
Add OpenRouter provider
Summary
Implement an OpenRouter provider backend so users can route to many hosted models with one key.
Scope
- Provider id:
openrouter. - Config/env:
OPENROUTER_API_KEY- Optional
OPENROUTER_BASE_URL(defaulthttps://openrouter.ai/api/v1) modelid (e.g.,openrouter/anthropic/claude-3.5-sonnet,openrouter/qwen/qwen2.5-coder:latest)
- Support in:
commitlm initprovider selection.commitlm generate --provider openrouter --model <id>.
- Respect existing fallback behavior to local HF when errors/timeouts occur.
Tasks
- Define provider adapter (auth header, timeouts/retries, error mapping).
- Unit tests with mocked HTTP for success/timeout/429.
- Update README configuration matrix and examples.
- Optional: list a few tested model ids in docs.
Acceptance criteria
-
commitlm validateconfirms connectivity for OpenRouter. - Generation works for commit message and docs paths.
- Clear errors on auth/rate-limit failures; fallback honored when configured.
Test plan
Set OPENROUTER_API_KEY; run commitlm generate --provider openrouter --model <id> in a temp repo; verify outputs.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthacktoberfestFor Hacktoberfest Participants!For Hacktoberfest Participants!help wantedExtra attention is neededExtra attention is neededup-for-grabs