Skip to content

fix(ui): Remove dead code for SLO input ranges - references non-existent file #74

@anfredette

Description

@anfredette

Description

The UI displays hardcoded fallback ranges for SLO target inputs (TTFT, ITL, E2E) because the code references a non-existent file data/benchmarks_redhat_performance.json.

Current Behavior

  • get_benchmark_ranges_for_token_config() in app.py:1627-1677 tries to load data/benchmarks_redhat_performance.json
  • The file doesn't exist, so the function silently returns {"config_count": 0}
  • get_metric_range() at app.py:3514-3529 falls back to hardcoded values:
    • TTFT: 15 - 270,000 ms
    • ITL: 3 - 430 ms
    • E2E: 800 - 300,000 ms
  • These static ranges are displayed below each input but don't reflect actual benchmark data

Why Static Ranges Are Problematic

Benchmark data can be loaded or reloaded at any time, which means valid SLO ranges can change during a session. Static hardcoded ranges:

  • Don't reflect what's actually achievable with the currently loaded benchmark data
  • Can't adapt when data is reloaded or reset
  • May show ranges that are misleading (e.g., suggesting 15ms TTFT is achievable when no loaded benchmark supports it)

Proposed Fix (Phase 1)

Remove the dead code and range display:

  1. Delete get_benchmark_ranges_for_token_config() function
  2. Remove the "Range: X - Y ms" text below each SLO input
  3. Remove the benchmark_ranges variable and get_metric_range() helper from the render functions

Future Enhancement Consideration

If dynamic ranges are needed later, consider:

  • Backend endpoint (e.g., GET /api/v1/benchmark-ranges) that calculates min/max from currently loaded benchmark data
  • Ranges computed based on workload profile (prompt_tokens, output_tokens)
  • Recalculated whenever benchmark data is loaded/unloaded/reset, with results cached by backend
  • UI fetches ranges when rendering the Technical Specification tab

This approach:

  1. Keeps range calculation server-side where the data lives, avoiding frontend/backend state sync issues
  2. Ensures ranges always reflect the currently loaded benchmark data, updating automatically when data changes
  3. Doesn't recalculate the ranges every time they need to be rendered

Files Affected

  • ui/app.py - Remove function and range display code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions