-
-
Notifications
You must be signed in to change notification settings - Fork 113
feat: add OpenRouter support with catalog-driven model resolution and cost-based routing #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
bdc792f
feat: add catalog management commands and sync functionality
samueltuyizere 72ad026
feat: add unit tests for catalog synchronization and directory resolu…
samueltuyizere 12f0ab0
feat: implement catalog synchronization with automatic syncing and co…
samueltuyizere f6a5898
feat: add catalog loading functionality with validation and indexing
samueltuyizere 1b50001
feat: implement provider model index creation and synchronization in …
samueltuyizere bc64b66
refactor: rename test functions for consistency and clarity
samueltuyizere ba0045c
feat: add OpenRouter provider support with configuration and tests
samueltuyizere bfa3e81
feat: enhance ModelRouter to support catalog-based model resolution a…
samueltuyizere 032c1dd
feat: enhance model resolution to handle unknown providers and add co…
samueltuyizere 3e57c68
feat: add tests for handling unknown providers in messages handler
samueltuyizere b6ef72e
fix: add missing period in error message for catalog not found
samueltuyizere 8264dd4
feat: enhance models command to support provider filtering and improv…
samueltuyizere 56ed94c
feat: add catalog synchronization and management features with corres…
samueltuyizere 0411bc4
fix: improve error messages and streamline output in models list command
samueltuyizere 2c0959b
feat: add tests for models list command with provider filtering and e…
samueltuyizere b6ecfdf
feat: add cost-based routing support and enhance model resolution logic
samueltuyizere 3754f07
feat: implement cost-based routing with configuration and tests
samueltuyizere 4640470
feat: add tests for SelectCheapest with constraint handling for tools…
samueltuyizere e178a78
Update internal/catalog/sync.go
samueltuyizere c2e232f
fix: remove unnecessary finalPath cleanup in Sync function
samueltuyizere b642ab9
style: format code for consistency in Sync function
samueltuyizere e625f50
feat: implement automatic catalog reloading in ModelRouter
samueltuyizere ce637b4
feat: enhance SelectCheapest and providerSet with effective penalties…
samueltuyizere a2d1642
feat: implement cost-based routing with provider penalties and contex…
samueltuyizere 53a3f56
fix: update config path in TestRoute_LegacyConfigFixtures for consist…
samueltuyizere e8888c3
Merge branch 'main' into add-open-router
samueltuyizere 2bd35d6
Merge branch 'main' into add-open-router
samueltuyizere 7622cfa
feat: add Fedora 44 setup guide to documentation
samueltuyizere e7d21ca
feat: add OpenRouter support and improve catalog sync handling
samueltuyizere bae1414
feat: add auto-detected rules for constructor pattern, context propag…
samueltuyizere e1abe1a
feat: update backend rules in config.yaml with auto-detected patterns…
samueltuyizere 3f94738
fix: remove duplicate entry for .worktrees/ in .gitignore
samueltuyizere 3f85c45
fix: remove duplicate entry for .worktrees/ in .gitignore
samueltuyizere ab592cb
feat(cli): add --provider flag to init command
samueltuyizere 0b93517
docs(cli): document --provider flag for init command
samueltuyizere c3cc044
refactor(cli): replace switch statement with provider config generato…
samueltuyizere 4a1ca3f
Revert "refactor(cli): replace switch statement with provider config …
samueltuyizere 6c495df
Revert "docs(cli): document --provider flag for init command"
samueltuyizere 267c53d
Revert "feat(cli): add --provider flag to init command"
samueltuyizere 3cc835b
feat: add OpenRouter provider support and enhance config initialization
samueltuyizere 91d8e8c
test: add tests for provider flag handling and config initialization
samueltuyizere c3a1e7d
feat(cli): add --provider flag to init command
samueltuyizere 2937eea
fix: Makefile CGO_ENABLED=0 default, tray: use build tags for platfor…
samueltuyizere 46699be
docs: update CLAUDE.md with Linux GUI support and platform-specific b…
samueltuyizere ac7d8af
fix: simplify lint target to avoid golangci-lint Go version issues
samueltuyizere c599118
feat(tests): add no-op UI test stub for Linux without CGO and tray de…
samueltuyizere d66905b
fix: add CGO_ENABLED=0 to CI lint job to avoid tray_linux.go CGO depe…
samueltuyizere 68351e9
Revert "fix: add CGO_ENABLED=0 to CI lint job to avoid tray_linux.go …
samueltuyizere b1aab52
fix: update golangci-lint args to exclude internal/tray directory
samueltuyizere d3d9f56
chore: add .golangci.yml for config
samueltuyizere 5ed61c4
fix: use go 1.24 for linting to match golangci-lint binary and exclud…
samueltuyizere befa417
refactor: remove system tray for Linux, use web portal only
samueltuyizere 9df98fa
fix: revert CI lint to use go-version-file and remove golangci-lint c…
samueltuyizere 155ea46
chore: remove .golangci.yml configuration file
samueltuyizere d41c720
feat: implement macOS GUI support with systray integration
samueltuyizere 3c0e745
fix: update install target in Makefile to use GOBIN and simplify command
samueltuyizere 7ff2762
feat: enhance catalog model handling with provider prefix extraction …
samueltuyizere a806227
feat: add catalog configuration for openrouter and opencode-go provid…
samueltuyizere 27fe0ea
feat: add debug logging to BuildProviderIndex for provider and model …
samueltuyizere 3df7760
feat: update golangci-lint configuration to remove internal/tray excl…
samueltuyizere 579c62a
feat: update catalog models to include provider prefixes and enhance …
samueltuyizere 9d44979
feat: update model references in tests and remove debug logging in pr…
samueltuyizere cc644ee
feat: implement advanced GUI features with new logging and metrics tr…
samueltuyizere 92ac4f7
feat: enhance logging functionality with streaming and history endpoints
samueltuyizere 56275d6
feat: simplify config anonymization in handleConfigExport
samueltuyizere 235a0af
feat: add performance monitoring and config backup/restore features i…
samueltuyizere 7b363d8
feat: add logs tab and update keyboard shortcuts in navigation
samueltuyizere bff658e
feat: add performance tab navigation and log viewer UI components
samueltuyizere cee782b
feat: add fallback tab navigation and update keyboard shortcuts
samueltuyizere 9849a8f
feat: add logging module with real-time log streaming and filtering c…
samueltuyizere c5b28e1
feat: update cost calculation in resolvedModel function to use model-…
samueltuyizere 354ac42
feat: update tab navigation shortcuts and add rates to selector catalog
samueltuyizere f0839f9
feat: add large context model for openrouter with updated rates and c…
samueltuyizere 2b69d64
feat: enhance model resolution to prefer specified provider and add c…
samueltuyizere eaccfb9
feat: update test cases for catalog synchronization and model routing
samueltuyizere 5137012
feat: update TestResolveShort_Legacy to check CanonicalName and corre…
samueltuyizere 3e1f350
feat: update catalog and model configurations for openrouter, enhance…
samueltuyizere 5f024fd
feat: update documentation for model addition process, enhance cost-b…
samueltuyizere 823a250
feat: add catalog schema documentation with key fields and model reso…
samueltuyizere fcd8448
feat: update golangci configuration to enable additional linters for …
samueltuyizere c898b91
feat: enhance ResolveShort to handle ambiguity and improve provider m…
samueltuyizere 05fc59f
feat: add tests for ambiguous model resolution and single enabled pro…
samueltuyizere 8752036
feat: update requested model in tests to use deepseek-v4-flash for co…
samueltuyizere 5a9e1e8
feat: add implementation and feature spec for SQLite-based storage so…
samueltuyizere ba31d61
feat: update dependencies in go.mod and go.sum for improved functiona…
samueltuyizere 5beb06f
feat: add storage configuration, implement latency and logs managemen…
samueltuyizere b9f7d48
feat: enhance performance metrics handling with improved latency calc…
samueltuyizere b9cd647
feat: refactor performance handling to streamline latency statistics …
samueltuyizere 7895e41
feat: implement SQLite storage initialization and retention managemen…
samueltuyizere 4ee98bf
feat: add StorageAdapter for SQLite persistence and integrate with Me…
samueltuyizere 8d8ee10
feat: integrate storage handling in MessagesHandler and update server…
samueltuyizere a497c29
feat: refactor StorageWriter interface and update MessagesHandler to …
samueltuyizere 4e4b430
feat: add requestID parameter to handleNonStreaming method in Message…
samueltuyizere c59e1d7
feat: pass requestID to handleStreaming and handleNonStreaming method…
samueltuyizere a7da8bf
feat: initialize SQLite database on server startup and create databas…
samueltuyizere f547f29
fix: adjust percentile index calculations to handle edge cases in lat…
samueltuyizere f57ba72
feat: enhance provider resolution to handle missing and disabled prov…
samueltuyizere ec0fb70
fix: update ResolveShort documentation to clarify matching logic and …
samueltuyizere df04ab5
feat: ensure SQLite database initialization on server startup
samueltuyizere 7e0ef25
feat: migrate catalog from JSON to SQLite
samueltuyizere c2b7069
feat: add support for catalog loading from a specified path in ModelR…
samueltuyizere 96e6797
feat: add migration function for catalog from JSON to SQLite in tests
samueltuyizere af94ba8
feat: add test for migrating catalog from JSON to SQLite
samueltuyizere 6a88ca5
feat: add function to write test config with database path and update…
samueltuyizere bb8967b
feat: update tests to use database path in configuration for enabled …
samueltuyizere 9848799
feat: add storage parameter to handleStreaming function in tests
samueltuyizere 5db4ddb
feat: add nil storage parameter to TestHandleNonStreaming tests
samueltuyizere 9593704
feat: update status of catalog SQLite migration plan to completed
samueltuyizere de9c914
feat: implement catalog stats endpoint and associated tests
samueltuyizere c4817a2
feat: clean up whitespace in migration and performance handling code
samueltuyizere 620d5f9
Update internal/storage/retention.go
samueltuyizere 4c0b76f
Update cmd/routatic-proxy/main.go
samueltuyizere 6476dfc
Update cmd/routatic-proxy/main.go
samueltuyizere c51f1ea
Update cmd/routatic-proxy/catalog.go
samueltuyizere 09c1b69
Update internal/storage/catalog.go
samueltuyizere 11f9792
Update cmd/routatic-proxy/catalog.go
samueltuyizere af98e95
Add pre-push git hook and install script; improve error handling in m…
samueltuyizere 1da2778
Add pre-push hook instructions to CONTRIBUTING.md for code quality ch…
samueltuyizere eb4c134
Refactor database initialization in main.go to simplify directory cre…
samueltuyizere f0aa9b5
Refactor ensureDatabase function to simplify database path resolution…
samueltuyizere 4c47561
Remove unused import of strings in catalog.go
samueltuyizere 963df62
Refactor code for consistency and readability; remove unnecessary whi…
samueltuyizere bc43586
Remove gofmt from enabled linters in .golangci.yml
samueltuyizere 596d324
fix: specify golangci-lint config version
samueltuyizere 81beeed
chore: update golangci-lint action to use latest version and remove d…
samueltuyizere 2d0ad0d
feat: add initial catalog.json with providers and models configuration
samueltuyizere 22c16cc
chore: remove outdated planning documents for SQLite migration, advan…
samueltuyizere c4616e9
fix: improve lint output and ensure pipefail in pre-push hook
samueltuyizere adc5f0c
fix: handle errors on resource closure to prevent potential panics
samueltuyizere d6c1f5e
fix: correct indentation for error handling in GUI server startup
samueltuyizere 48af591
fix: address remaining golangci-lint issues
samueltuyizere 3ceb0f4
fix: correct indentation for gofmt compliance
samueltuyizere 99cb066
fix: address remaining golangci-lint errcheck issues
samueltuyizere 7097ab2
fix: check rows.Close error in requests.go:82
samueltuyizere d6917eb
Update Makefile
samueltuyizere a13b45b
feat: implement existing proxy detection and connection handling in u…
samueltuyizere a67713d
fix: replace strings package with bytes for performance improvements …
samueltuyizere 34be514
refactor: change string parameters to byte slices for improved perfor…
samueltuyizere c1b4c5e
fix: update line handling in ProxyStream and processSSELine to use st…
samueltuyizere 55416cb
fix: resolve GUI model iteration error and restore working stream.go
samueltuyizere f845473
perf(transformer): eliminate SSE parsing allocations
samueltuyizere 15f4486
fix: add function to check for existing proxy before starting GUI server
samueltuyizere 12eb3a0
feat: add golangci-lint to pre-push checks
samueltuyizere bd742e3
fix: remove unused log level query parameter in handleLogsHistory
samueltuyizere ebd3e41
fix: resolve golangci-lint issues
samueltuyizere e3fbdc3
feat(gui): remove logs tab and streaming functionality
samueltuyizere 2f3cbbb
fix: run gofmt on server.go after removing logs
samueltuyizere af32e6c
feat(metrics): add model-specific failure tracking and update snapsho…
samueltuyizere 22e2a2d
feat(metrics): add per-model success and failure tracking
samueltuyizere 788c821
fix: remove unnecessary closing brace in GetSnapshot function
samueltuyizere 96143b8
fix(gui): success rate shows 0% due to missing per-model success/fail…
samueltuyizere cd91105
refactor(gui): remove logs tab and associated elements from the inter…
samueltuyizere e9adf74
fix(metrics): wire RecordFailureForModel into failure paths
samueltuyizere 46f7885
fix(metrics): use lastModelID for final failure recording
samueltuyizere a1d57a6
fix(metrics): declare lastModelID in outer scope for fallback failure
samueltuyizere d0434fb
fix: resolve duplicate RecordFailureForModel and undeclared lastModelID
samueltuyizere 087cbc4
fix: use global RecordFailure at final streaming fallback
samueltuyizere 1afc936
refactor: remove unused log entry styles from CSS
samueltuyizere 1975ffc
Update internal/gui/assets/app.js
samueltuyizere 21bc601
fix: improve error handling for model and prompt validation
samueltuyizere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,4 +56,4 @@ jobs: | |
| uses: golangci/golangci-lint-action@v7 | ||
| with: | ||
| version: latest | ||
| args: --timeout 5m | ||
| args: --timeout 5m | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # .spartan/config.yaml — Generated by /spartan:init-rules | ||
| # Validate: /spartan:lint-rules | ||
| # Auto-detect rules from code: /spartan:scan-rules | ||
|
|
||
| # ─── Stack & Architecture ─────────────────────────────────────────── | ||
|
|
||
| stack: go-standard | ||
| architecture: clean | ||
|
|
||
| # ─── Rules ────────────────────────────────────────────────────────── | ||
|
|
||
| rules: | ||
| shared: [] | ||
| # Add rules that apply to both backend and frontend | ||
|
|
||
| backend: | ||
| - rules/auto-detected/ERROR_HANDLING.md | ||
| - rules/auto-detected/CONSTRUCTOR_PATTERN.md | ||
| - rules/auto-detected/CONTEXT_PROPAGATION.md | ||
| - rules/auto-detected/SLOG_LOGGING.md | ||
| - rules/auto-detected/TEST_HELPERS.md | ||
| - rules/auto-detected/JSON_RAWMESSAGE.md | ||
| - rules/auto-detected/SYNC_MUTEX.md | ||
|
|
||
| frontend: [] | ||
| # Add frontend-specific rules | ||
|
|
||
| # ─── File Type Mapping ────────────────────────────────────────────── | ||
|
|
||
| file-types: | ||
| backend: [".go"] | ||
| frontend: [] | ||
| migration: [".sql"] | ||
| config: [".yaml", ".yml", ".json", ".toml"] | ||
|
|
||
| # ─── Review Stages ────────────────────────────────────────────────── | ||
|
|
||
| review-stages: | ||
| - correctness | ||
| - stack-conventions | ||
| - test-coverage | ||
| - architecture | ||
| - database-api | ||
| - security | ||
| - documentation-gaps | ||
|
|
||
| # ─── Build Commands ───────────────────────────────────────────────── | ||
|
|
||
| commands: | ||
| test: | ||
| backend: "make test" | ||
| frontend: "" | ||
| build: | ||
| backend: "make build" | ||
| frontend: "" | ||
| lint: | ||
| backend: "make lint" | ||
| frontend: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.