-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: filtering adapter #57
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
Conversation
Caution Review failedThe pull request is closed. WalkthroughIntroduces a glob-pattern filtering system for profiles and models, wiring it into profile loading and endpoint discovery. Adds domain types and ports, a GlobFilter implementation with repository, config fields, and utilities. Updates discovery and profile registry to use filters. Expands documentation and README. Adds extensive unit and integration tests. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as Application
participant Factory as Profile Factory
participant Loader as ProfileLoader
participant Filter as Filter (Glob)
participant FS as Profiles Dir / Built-ins
App->>Factory: NewProfileLoaderWithFilter(dir, profile_filter, glob)
Factory->>Loader: construct with filter+config
App->>Loader: LoadProfiles()
Loader->>FS: Load built-ins + YAML
FS-->>Loader: allProfiles map
Loader->>Filter: ApplyToMap(profile_filter, allProfiles)
alt no/empty filter
Loader->>Loader: use allProfiles
else filtered
Filter-->>Loader: filteredProfiles map
Loader->>Loader: assign filtered to internal registry
end
Loader-->>App: profiles ready
sequenceDiagram
autonumber
participant Boot as Startup
participant Repo as StaticEndpointRepository
participant Disc as ModelDiscoveryService
participant E as Endpoint
participant Client as DiscoveryClient
participant Filter as Filter (Glob)
participant Reg as ModelRegistry
Boot->>Repo: LoadFromConfig(endpoints...)
Repo-->>Boot: endpoints with ModelFilter
Boot->>Disc: NewModelDiscoveryService(glob)
loop each endpoint
Disc->>E: getEndpointFilterConfig()
Disc->>Client: DiscoverModels(E)
Client-->>Disc: models[]
alt filter present
Disc->>Filter: Apply(filterConfig, models[])
Filter-->>Disc: Accepted/Rejected
Disc->>Reg: Register(Accepted)
else no filter
Disc->>Reg: Register(models[])
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (22)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
This PR brings in a generic filter adapter to configuration bits. It supports
include
andexclude
types with glob support for now.Enabled for
profiles
(so you can avoid say vllm profile when you don't have vllm) and models for an endpoint.This should help with the likes of LiteLLM etc and future work to enable #47 so you can exclude/include models as necessary (or even create model specific endpoints).
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Tests