Skip to content

Conversation

Butanium
Copy link
Owner

Implements a .serve() method for both OfflineFeatureCentricDashboard and AbstractOnlineFeatureCentricDashboard that opens a web interface in the browser while keeping the notebook non-blocking.

Architecture:

  • Created BaseServableDashboard abstract class with FastAPI server logic
  • Both dashboard classes inherit from it and implement:
    • get_initial_html(): Returns form UI
    • handle_request(): Processes form submissions
  • Reuses existing HTML generation code

Features:

  • Non-blocking: Returns control to notebook immediately
  • Clean web UI with forms for all dashboard options
  • Works alongside existing .display() for Jupyter widgets
  • All subclasses get .serve() for free

Dependencies added:

  • fastapi
  • uvicorn[standard]
  • python-multipart

Usage:
dashboard.serve(port=8000, open_browser=True, block=False)

Generated with Claude Code

Implements a .serve() method for both OfflineFeatureCentricDashboard
and AbstractOnlineFeatureCentricDashboard that opens a web interface
in the browser while keeping the notebook non-blocking.

Architecture:
- Created BaseServableDashboard abstract class with FastAPI server logic
- Both dashboard classes inherit from it and implement:
  - get_initial_html(): Returns form UI
  - handle_request(): Processes form submissions
- Reuses existing HTML generation code

Features:
- Non-blocking: Returns control to notebook immediately
- Clean web UI with forms for all dashboard options
- Works alongside existing .display() for Jupyter widgets
- All subclasses get .serve() for free

Dependencies added:
- fastapi
- uvicorn[standard]
- python-multipart

Usage:
  dashboard.serve(port=8000, open_browser=True, block=False)

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Butanium Butanium requested a review from Copilot October 21, 2025 08:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a .serve() method to enable non-blocking browser-based serving of feature dashboards using FastAPI and uvicorn. The implementation creates a web interface that allows users to interact with dashboards through HTML forms while keeping notebooks responsive.

Key changes:

  • Introduces BaseServableDashboard abstract class providing web server infrastructure
  • Both OfflineFeatureCentricDashboard and AbstractOnlineFeatureCentricDashboard now inherit from BaseServableDashboard and implement form UI and request handling
  • Adds FastAPI, uvicorn, and python-multipart as dependencies

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tiny_dashboard/base_servable_dashboard.py New abstract base class providing web serving capability with FastAPI/uvicorn
tiny_dashboard/feature_centric_dashboards.py Added inheritance from BaseServableDashboard and implemented get_initial_html() and handle_request() methods
tiny_dashboard/init.py Exported BaseServableDashboard
test_serve.py Test script using real transformers tokenizer
test_serve_simple.py Test script using mock tokenizer
pyproject.toml Added fastapi, uvicorn, and python-multipart dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants