Spaces:
Paused
Paused
Mirrowel
commited on
Commit
Β·
ad2ed1a
1
Parent(s):
923eb65
docs: π add comprehensive Model Filter GUI documentation
Browse filesAdd complete documentation for the Model Filter GUI feature including overview, features, keyboard shortcuts, context menu operations, and proxy integration details.
- Documents GUI launch methods and provider selection
- Explains ignore/whitelist rule system with wildcard support
- Details dual-pane model view with color-coded status indicators
- Lists all keyboard shortcuts (Ctrl+S, Ctrl+R, Ctrl+F, F1, Escape)
- Describes right-click context menu functionality
- Clarifies integration flow with RotatingClient and .env persistence
- Adds cross-reference to Section 6 in project overview
- DOCUMENTATION.md +81 -0
DOCUMENTATION.md
CHANGED
|
@@ -10,6 +10,7 @@ The project is a monorepo containing two primary components:
|
|
| 10 |
* **Batch Manager**: Optimizes high-volume embedding requests.
|
| 11 |
* **Detailed Logger**: Provides per-request file logging for debugging.
|
| 12 |
* **OpenAI-Compatible Endpoints**: `/v1/chat/completions`, `/v1/embeddings`, etc.
|
|
|
|
| 13 |
2. **The Resilience Library (`rotator_library`)**: This is the core engine that provides high availability. It is consumed by the proxy app to manage a pool of API keys, handle errors gracefully, and ensure requests are completed successfully even when individual keys or provider endpoints face issues.
|
| 14 |
|
| 15 |
This architecture cleanly separates the API interface from the resilience logic, making the library a portable and powerful tool for any application needing robust API key management.
|
|
@@ -1145,3 +1146,83 @@ stats = cache.get_stats()
|
|
| 1145 |
# Includes: {"disk_available": True, "disk_errors": 0, ...}
|
| 1146 |
```
|
| 1147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
* **Batch Manager**: Optimizes high-volume embedding requests.
|
| 11 |
* **Detailed Logger**: Provides per-request file logging for debugging.
|
| 12 |
* **OpenAI-Compatible Endpoints**: `/v1/chat/completions`, `/v1/embeddings`, etc.
|
| 13 |
+
* **Model Filter GUI**: Visual interface for configuring model ignore/whitelist rules per provider (see Section 6).
|
| 14 |
2. **The Resilience Library (`rotator_library`)**: This is the core engine that provides high availability. It is consumed by the proxy app to manage a pool of API keys, handle errors gracefully, and ensure requests are completed successfully even when individual keys or provider endpoints face issues.
|
| 15 |
|
| 16 |
This architecture cleanly separates the API interface from the resilience logic, making the library a portable and powerful tool for any application needing robust API key management.
|
|
|
|
| 1146 |
# Includes: {"disk_available": True, "disk_errors": 0, ...}
|
| 1147 |
```
|
| 1148 |
|
| 1149 |
+
---
|
| 1150 |
+
|
| 1151 |
+
## 6. Model Filter GUI
|
| 1152 |
+
|
| 1153 |
+
The Model Filter GUI (`model_filter_gui.py`) provides a visual interface for configuring model ignore and whitelist rules per provider. It replaces the need to manually edit `IGNORE_MODELS_*` and `WHITELIST_MODELS_*` environment variables.
|
| 1154 |
+
|
| 1155 |
+
### 6.1. Overview
|
| 1156 |
+
|
| 1157 |
+
**Purpose**: Visually manage which models are exposed via the `/v1/models` endpoint for each provider.
|
| 1158 |
+
|
| 1159 |
+
**Launch**:
|
| 1160 |
+
```bash
|
| 1161 |
+
python -c "from src.proxy_app.model_filter_gui import run_model_filter_gui; run_model_filter_gui()"
|
| 1162 |
+
```
|
| 1163 |
+
|
| 1164 |
+
Or via the launcher TUI if integrated.
|
| 1165 |
+
|
| 1166 |
+
### 6.2. Features
|
| 1167 |
+
|
| 1168 |
+
#### Core Functionality
|
| 1169 |
+
|
| 1170 |
+
- **Provider Selection**: Dropdown to switch between available providers with automatic model fetching
|
| 1171 |
+
- **Ignore Rules**: Pattern-based rules (supports wildcards like `*-preview`, `gpt-4*`) to exclude models
|
| 1172 |
+
- **Whitelist Rules**: Pattern-based rules to explicitly include models, overriding ignore rules
|
| 1173 |
+
- **Real-time Preview**: Typing in rule input fields highlights affected models before committing
|
| 1174 |
+
- **Rule-Model Linking**: Click a model to highlight the affecting rule; click a rule to highlight all affected models
|
| 1175 |
+
- **Persistence**: Rules saved to `.env` file in standard `IGNORE_MODELS_<PROVIDER>` and `WHITELIST_MODELS_<PROVIDER>` format
|
| 1176 |
+
|
| 1177 |
+
#### Dual-Pane Model View
|
| 1178 |
+
|
| 1179 |
+
The interface displays two synchronized lists:
|
| 1180 |
+
|
| 1181 |
+
| Left Pane | Right Pane |
|
| 1182 |
+
|-----------|------------|
|
| 1183 |
+
| All fetched models (plain text) | Same models with color-coded status |
|
| 1184 |
+
| Shows total count | Shows available/ignored count |
|
| 1185 |
+
| Scrolls in sync with right pane | Color indicates affecting rule |
|
| 1186 |
+
|
| 1187 |
+
**Color Coding**:
|
| 1188 |
+
- **Green**: Model is available (no rule affects it, or whitelisted)
|
| 1189 |
+
- **Red/Orange tones**: Model is ignored (color matches the specific ignore rule)
|
| 1190 |
+
- **Blue/Teal tones**: Model is explicitly whitelisted (color matches the whitelist rule)
|
| 1191 |
+
|
| 1192 |
+
#### Rule Management
|
| 1193 |
+
|
| 1194 |
+
- **Comma-separated input**: Add multiple rules at once (e.g., `*-preview, *-beta, gpt-3.5*`)
|
| 1195 |
+
- **Wildcard support**: `*` matches any characters (e.g., `gemini-*-preview`)
|
| 1196 |
+
- **Affected count**: Each rule shows how many models it affects
|
| 1197 |
+
- **Tooltips**: Hover over a rule to see the list of affected models
|
| 1198 |
+
- **Instant delete**: Click the Γ button to remove a rule immediately
|
| 1199 |
+
|
| 1200 |
+
### 6.3. Keyboard Shortcuts
|
| 1201 |
+
|
| 1202 |
+
| Shortcut | Action |
|
| 1203 |
+
|----------|--------|
|
| 1204 |
+
| `Ctrl+S` | Save changes to `.env` |
|
| 1205 |
+
| `Ctrl+R` | Refresh models from provider |
|
| 1206 |
+
| `Ctrl+F` | Focus search field |
|
| 1207 |
+
| `F1` | Show help dialog |
|
| 1208 |
+
| `Escape` | Clear search / Clear highlights |
|
| 1209 |
+
|
| 1210 |
+
### 6.4. Context Menu
|
| 1211 |
+
|
| 1212 |
+
Right-click on any model to access:
|
| 1213 |
+
|
| 1214 |
+
- **Add to Ignore List**: Creates an ignore rule for the exact model name
|
| 1215 |
+
- **Add to Whitelist**: Creates a whitelist rule for the exact model name
|
| 1216 |
+
- **View Affecting Rule**: Highlights the rule that affects this model
|
| 1217 |
+
- **Copy Model Name**: Copies the full model ID to clipboard
|
| 1218 |
+
|
| 1219 |
+
### 6.5. Integration with Proxy
|
| 1220 |
+
|
| 1221 |
+
The GUI modifies the same environment variables that the `RotatingClient` reads:
|
| 1222 |
+
|
| 1223 |
+
1. **GUI saves rules** β Updates `.env` file
|
| 1224 |
+
2. **Proxy reads on startup** β Loads `IGNORE_MODELS_*` and `WHITELIST_MODELS_*`
|
| 1225 |
+
3. **Proxy applies rules** β `get_available_models()` filters based on rules
|
| 1226 |
+
|
| 1227 |
+
**Note**: The proxy must be restarted to pick up rule changes made via the GUI (or use the Launcher TUI's reload functionality if available).
|
| 1228 |
+
|