Skip to content

RI-SCALE/model-hub

 
 

Repository files navigation

RI-SCALE Model Hub Implementation

This repository contains the frontend code for the RI-SCALE Model Hub, utilizing the Hypha backend.

Developer Tools & Scripts

The scripts/ directory contains several utility scripts for managing the hub during development.

Setup

Ensure you have the required Python packages installed:

pip install hypha-rpc requests

1. Fixing Permissions (scripts/fix_hub_permissions.py)

If you encounter 403 Forbidden errors when accessing the hub or artifacts (especially after changing storage backends), use this script to restore public read access.

Usage:

# Using a token directly
python3 scripts/fix_hub_permissions.py --token <YOUR_HYPHA_TOKEN>

# Using environment variable
export HYPHA_TOKEN=<YOUR_HYPHA_TOKEN>
python3 scripts/fix_hub_permissions.py

2. Uploading Sample Artifacts (scripts/upload_sample.py)

To upload a sample artifact that demonstrates the "Open App" (static site) feature:

# Using a token
python3 scripts/upload_sample.py --token <YOUR_HYPHA_TOKEN>

This will create an artifact ri-scale/sample-static-app containing an index.html file.

3. Diagnosing Issues (scripts/diagnose_hub.py)

Run this script to inspect the current configuration and permissions of the hub artifact without modifying them.

python3 scripts/diagnose_hub.py

Features

Static Site Hosting ("Open App")

Artifacts containing an index.html file will display an "Open App" button in the interface. This opens the static site directly in the browser, served via Hypha.

Chat Proxy CI/CD Blueprint

For branch-safe dev deployments, production-only app IDs, health monitoring, and rollback automation, see:

  • docs/chat-proxy-cicd.md

Agent Architecture Principles

  • Keep src/pages/AgentPage.tsx agent-agnostic. It should orchestrate execution, retries, and generic fallback handling only.
  • Keep BioImage Finder domain logic in scripts/agent_startup_scripts/bioimage_finder_startup_script.py.
  • BioImage-specific search result shaping (compact payloads) and dataset fallback summaries must be implemented in the startup script, not in generic frontend orchestration code.
  • Keep chat-proxy app agent-agnostic with a minimal surface (setup, chat_completion, resolve_url).

About

The RI-SCALE Model Hub

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 49.8%
  • TypeScript 41.9%
  • Python 5.7%
  • CSS 1.8%
  • HTML 0.8%