Web Helper API Reference¶
Backend¶
models
¶
Database models for CVLab-Kit web helper.
Device
¶
Bases: Base
Database model for compute devices.
Source code in web_helper/backend/models/device.py
JobPriority
¶
JobStatus
¶
Bases: str, Enum
Job status enumeration
Source code in web_helper/backend/models/queue.py
QueueJob
¶
Bases: BaseModel
Queue job model (Experiment)
Source code in web_helper/backend/models/queue.py
QueueStats
¶
Bases: BaseModel
Queue statistics
Source code in web_helper/backend/models/queue.py
ResourceRequirement
¶
Bases: BaseModel
Resource requirements for a job
Source code in web_helper/backend/models/queue.py
QueueExperiment
¶
Bases: Base
Database model for queue experiment execution history.
Source code in web_helper/backend/models/queue_experiment.py
Run
¶
Bases: Base
Database model for experiment runs.
Source code in web_helper/backend/models/run.py
CodeVersion
¶
Bases: BaseModel
Code version information for reproducibility tracking.
Worker reports this on each heartbeat to ensure experiment reproducibility. Server stores this with experiment results for audit trail.
Source code in web_helper/backend/models/sync.py
FileCheckpoint
¶
Bases: BaseModel
Checkpoint for a single file's sync state.
Used for delta synchronization of append-only files (CSV, log).
Source code in web_helper/backend/models/sync.py
SyncCheckpoint
¶
Bases: BaseModel
Complete checkpoint for experiment synchronization.
Stored on both Server and Worker for recovery after disconnection.
Source code in web_helper/backend/models/sync.py
SyncRequest
¶
Bases: BaseModel
Request model for file synchronization API.
Worker sends this to Server to upload experiment files.
Source code in web_helper/backend/models/sync.py
SyncResponse
¶
Bases: BaseModel
Response model for file synchronization API.
Server returns this to confirm sync status.
Source code in web_helper/backend/models/sync.py
SyncStatus
¶
Bases: str, Enum
Synchronization status for experiment files.
Source code in web_helper/backend/models/sync.py
SyncStatusRequest
¶
Bases: BaseModel
Request model for querying sync status.
Worker sends this on reconnection to determine what needs to be re-synced.
Source code in web_helper/backend/models/sync.py
SyncStatusResponse
¶
Bases: BaseModel
Response model for sync status query.
Server returns current sync state for requested files.
Source code in web_helper/backend/models/sync.py
ComponentVersion
¶
Bases: Base
Database model for component versions (content-addressable storage).
Source code in web_helper/backend/models/component.py
ExperimentComponentManifest
¶
Bases: Base
Database model for experiment component snapshots (reproducibility).
Source code in web_helper/backend/models/component.py
ComponentVersionResponse
¶
Bases: BaseModel
Response model for component version.
Source code in web_helper/backend/models/component.py
ComponentListItem
¶
Bases: BaseModel
List item for component overview.
Source code in web_helper/backend/models/component.py
ComponentUploadRequest
¶
Bases: BaseModel
Request model for uploading a new component version.
Source code in web_helper/backend/models/component.py
ComponentUploadResponse
¶
Bases: BaseModel
Response model for component upload.
Source code in web_helper/backend/models/component.py
ComponentActivateRequest
¶
ComponentDiffRequest
¶
ComponentDiffResponse
¶
ComponentSyncRequest
¶
Bases: BaseModel
Request model for component synchronization.
Source code in web_helper/backend/models/component.py
ComponentSyncResponse
¶
Bases: BaseModel
Response model for component synchronization.
Source code in web_helper/backend/models/component.py
ExperimentManifestResponse
¶
Bases: BaseModel
Response model for experiment component manifest.
Source code in web_helper/backend/models/component.py
get_db
¶
init_database
¶
Initialize database tables.
services
¶
Business logic services.
EventManager
¶
Manages Server-Sent Events connections and broadcasts.
Source code in web_helper/backend/services/event_manager.py
connect
async
¶
Add a new SSE connection.
Source code in web_helper/backend/services/event_manager.py
disconnect
async
¶
Remove an SSE connection.
broadcast
async
¶
Broadcast data to all connected clients.
Source code in web_helper/backend/services/event_manager.py
send_device_update
async
¶
Send device status update.
Source code in web_helper/backend/services/event_manager.py
send_queue_update
async
¶
Send queue status update.
Source code in web_helper/backend/services/event_manager.py
send_run_update
async
¶
Send experiment run update.
FileMonitor
¶
Monitors file system changes in CVLab-Kit logs directory.
Source code in web_helper/backend/services/file_monitor.py
start
async
¶
Start file monitoring.
Source code in web_helper/backend/services/file_monitor.py
stop
async
¶
QueueFileMonitor
¶
Monitors file system changes in queue_logs directory.
Source code in web_helper/backend/services/queue_file_monitor.py
start
async
¶
Start file monitoring.
Source code in web_helper/backend/services/queue_file_monitor.py
stop
async
¶
Stop file monitoring.
ComponentStore
¶
Service for managing component versions.
Source code in web_helper/backend/services/component_store.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
get_all_components
¶
Get list of all registered components with their active versions.
Source code in web_helper/backend/services/component_store.py
get_components_by_category
¶
Get components filtered by category.
Source code in web_helper/backend/services/component_store.py
get_component_versions
¶
Get all versions of a specific component.
Source code in web_helper/backend/services/component_store.py
get_version_by_hash
¶
Get specific version by hash.
Source code in web_helper/backend/services/component_store.py
get_active_version
¶
Get current active version for a component path.
Source code in web_helper/backend/services/component_store.py
upload_version
¶
Upload a new component version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Component path like "agent/classification.py" |
required |
content
|
str
|
Python code content |
required |
activate
|
bool
|
Whether to activate this version |
True
|
Returns:
| Type | Description |
|---|---|
tuple[ComponentVersionResponse, bool]
|
Tuple of (ComponentVersionResponse, is_new) |
Source code in web_helper/backend/services/component_store.py
activate_version
¶
Activate a specific version (rollback).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hash
|
str
|
Content hash of the version to activate |
required |
restore_local
|
bool
|
If True, also restore the local file with version content |
True
|
Source code in web_helper/backend/services/component_store.py
get_active_hashes
¶
Get active hashes for multiple paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
list[str]
|
List of component paths |
required |
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Dictionary of {path: hash} for active versions |
Source code in web_helper/backend/services/component_store.py
save_experiment_manifest
¶
Save component versions used in an experiment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
experiment_uid
|
str
|
Experiment identifier |
required |
components
|
dict[str, str]
|
Dictionary of {path: hash} |
required |
Source code in web_helper/backend/services/component_store.py
get_experiment_manifest
¶
Get component manifest for an experiment.
Source code in web_helper/backend/services/component_store.py
get_components_to_sync
¶
Determine which components need to be synced.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
required_paths
|
list[str]
|
List of component paths needed |
required |
local_hashes
|
dict[str, str]
|
Current hashes on worker {path: hash} |
required |
Returns:
| Type | Description |
|---|---|
tuple[list[str], dict[str, ComponentVersionResponse]]
|
Tuple of (hashes_to_download, component_info) |
Source code in web_helper/backend/services/component_store.py
scan_local_components
¶
Scan local cvlabkit components and register them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_path
|
Path
|
Base path to cvlabkit (default: ./cvlabkit) |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Number of components registered |
Source code in web_helper/backend/services/component_store.py
Frontend¶
Refer to TypeScript interface definitions in web_helper/frontend/src/types/.