Spaces:
Sleeping
Sleeping
feat: Convert InferRoute Space to Static SDK with unified hub serving Quant.ai & InferRoute Gateway
Browse files- README.md +1 -2
- assets +1 -0
- index.html +107 -0
- platform.html +614 -0
- quant.html +14 -0
- scratch/deploy_inferroute_space.py +1 -1
README.md
CHANGED
|
@@ -3,8 +3,7 @@ title: InferRoute Multi-LLM Gateway
|
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
|
|
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: static
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
assets
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;color:#fff;--color-green:#00c805;--color-red:#ff3b30;--color-bg-dark:#000;--color-bg-card:#1e1e1e;--color-border:#333;--color-text-secondary:#8e8e93;background-color:#000;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-weight:400;line-height:1.5}body{background-color:var(--color-bg-dark);min-height:100vh;margin:0;padding:0}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:#000}::-webkit-scrollbar-thumb{background:#2c2c2e;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#3a3a3c}.header-bar{border-bottom:1px solid var(--color-border);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:#1e1e1e33;justify-content:space-between;align-items:center;padding:1rem 2rem;display:flex}.logo{color:#fff;align-items:center;gap:.5rem;font-size:1.5rem;font-weight:800;display:flex}.logo span{color:var(--color-green)}.app-container{background-color:#000;grid-template-columns:1fr 300px;min-height:calc(100vh - 65px);display:grid}.main-content{border-right:1px solid var(--color-border);flex-direction:column;gap:2rem;padding:2rem;display:flex;overflow-y:auto}.sidebar{background-color:#000;flex-direction:column;gap:1.5rem;padding:2rem 1.5rem;display:flex}.sidebar-title{color:#fff;border-bottom:1px solid var(--color-border);margin:0 0 .5rem;padding-bottom:.5rem;font-size:1.1rem;font-weight:700}.watchlist-item{cursor:pointer;background-color:#1c1c1e;border:1px solid #0000;border-radius:8px;justify-content:space-between;align-items:center;padding:.75rem 1rem;transition:all .2s;display:flex}.watchlist-item:hover{border-color:var(--color-green);background-color:#2c2c2e}.watchlist-item.active{border-color:var(--color-green);background-color:#00c8051a}.watchlist-ticker{font-size:1.1rem;font-weight:700}.watchlist-price{text-align:right;font-weight:600}.pnl-container{flex-direction:column;gap:.25rem;display:flex}.portfolio-value{letter-spacing:-1px;font-size:3rem;font-weight:800}.pnl-text{align-items:center;gap:.25rem;font-size:1.1rem;font-weight:600;display:flex}.pnl-text.up{color:var(--color-green)}.pnl-text.down{color:var(--color-red)}.time-tabs{gap:.5rem;margin-top:1rem;display:flex}.tab-btn{color:var(--color-text-secondary);cursor:pointer;background:0 0;border:none;border-radius:4px;padding:.4rem .8rem;font-size:.9rem;font-weight:700;transition:all .2s}.tab-btn:hover{color:#fff;background-color:#1c1c1e}.tab-btn.active{color:var(--color-green);background-color:#00c8051a}.card{border:1px solid var(--color-border);background-color:#1c1c1e;border-radius:12px;padding:1.5rem}.card-title{color:#fff;margin:0 0 1rem;font-size:1.1rem;font-weight:700}.stats-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1.5rem;display:grid}.stat-box{flex-direction:column;gap:.25rem;display:flex}.stat-label{color:var(--color-text-secondary);font-size:.85rem;font-weight:600}.stat-value{font-size:1.4rem;font-weight:800}.ledger-table{border-collapse:collapse;text-align:left;width:100%}.ledger-table th{color:var(--color-text-secondary);border-bottom:1px solid var(--color-border);padding:.75rem 1rem;font-size:.9rem;font-weight:600}.ledger-table td{border-bottom:1px solid var(--color-border);padding:1rem;font-size:.95rem}.ledger-table tr:hover{background-color:#ffffff05}.action-badge{border-radius:4px;padding:.25rem .5rem;font-size:.8rem;font-weight:700}.action-badge.buy{color:var(--color-green);background-color:#00c80526}.action-badge.sell{color:var(--color-red);background-color:#ff3b3026}.chart-wrapper{border:1px solid var(--color-border);background-color:#000;border-radius:12px;width:100%;height:400px;position:relative;overflow:hidden}.loader-container{border:1px solid var(--color-border);height:400px;color:var(--color-text-secondary);background-color:#1c1c1e;border-radius:12px;justify-content:center;align-items:center;font-size:1.2rem;font-weight:600;display:flex}input[type=range]{-webkit-appearance:none;background:#2c2c2e;border-radius:3px;outline:none;width:100%;height:6px;margin:10px 0}input[type=range]::-webkit-slider-thumb{appearance:none;background:var(--color-green);cursor:pointer;border-radius:50%;width:16px;height:16px;transition:transform .1s}input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.25)}select:focus,input[type=text]:focus{outline:none;box-shadow:0 0 0 1px #00c80533;border-color:var(--color-green)!important}.ledger-table td button{transition:all .2s}.pnl-header-container{flex-flow:wrap;justify-content:space-between;align-items:flex-end;gap:1rem;display:flex}.interval-picker-container{flex-direction:column;align-items:flex-end;gap:6px;display:flex}.strategy-patterns-grid{grid-template-columns:1.2fr .8fr;gap:2rem;display:grid}.nav-tabs{border:1px solid var(--color-border);background:#1c1c1e;border-radius:10px;gap:4px;padding:3px;display:flex}.nav-tab{color:var(--color-text-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;padding:8px 20px;font-size:.85rem;font-weight:700;transition:all .25s}.nav-tab:hover{color:#fff;background:#ffffff0d}.nav-tab.active{color:#000;background:var(--color-green)}.stats-divider{background:var(--color-border);height:1px;margin:1.25rem 0}.chat-panel{border:1px solid var(--color-border);background:#111;border-radius:16px;flex-direction:column;max-height:700px;display:flex;overflow:hidden}.chat-header{border-bottom:1px solid var(--color-border);background:#1e1e1e99;justify-content:space-between;align-items:center;padding:14px 20px;display:flex}.chat-header-title{align-items:center;gap:8px;font-size:1rem;font-weight:700;display:flex}.chat-icon{font-size:1.2rem}.chat-status{color:var(--color-green);font-size:.8rem;font-weight:600}.chat-messages{flex-direction:column;flex:1;gap:12px;max-height:500px;padding:16px;display:flex;overflow-y:auto}.chat-msg{display:flex}.chat-msg-user{justify-content:flex-end}.chat-msg-bubble{word-break:break-word;border-radius:16px;max-width:85%;padding:12px 16px;font-size:.9rem;line-height:1.6}.chat-msg-user-bubble{background:var(--color-green);color:#000;border-bottom-right-radius:4px;font-weight:600}.chat-msg-system-bubble{color:var(--color-text-secondary);background:#8e8e931f;border-bottom-left-radius:4px;font-size:.85rem}.chat-msg-assistant-bubble{color:#e0e0e0;border:1px solid var(--color-border);background:#1c1c1e;border-bottom-left-radius:4px}.chat-config-preview{background:#0000004d;border:1px solid #ffffff0f;border-radius:10px;margin-top:12px;padding:12px}.chat-config-title{color:#fff;margin-bottom:10px;font-size:.85rem;font-weight:700}.chat-config-grid{grid-template-columns:1fr 1fr;gap:6px 16px;display:grid}.chat-config-item{justify-content:space-between;padding:3px 0;font-size:.8rem;display:flex}.chat-config-key{color:var(--color-text-secondary)}.chat-config-val{color:var(--color-green);font-family:SF Mono,Fira Code,monospace;font-weight:600}.chat-plan{background:#0000004d;border:1px solid #ffffff0f;border-radius:10px;margin-top:12px;padding:12px}.chat-plan-step{align-items:flex-start;gap:10px;padding:6px 0;display:flex}.chat-plan-step-num{background:var(--color-green);color:#000;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:22px;height:22px;font-size:.7rem;font-weight:800;display:flex}.chat-plan-tool{color:#af52de;font-family:SF Mono,Fira Code,monospace;font-size:.8rem;font-weight:700;display:block}.chat-plan-desc{color:var(--color-text-secondary);font-size:.8rem}.chat-risk-report{background:#0006;border:1px solid #ffffff14;border-radius:12px;margin-top:12px;padding:16px}.chat-risk-header{justify-content:space-between;align-items:center;margin-bottom:16px;display:flex}.risk-score-badge{text-align:center;border:2px solid;border-radius:12px;min-width:70px;padding:6px 16px}.risk-score-value{font-size:1.6rem;font-weight:800;line-height:1}.risk-score-label{text-transform:uppercase;letter-spacing:.5px;font-size:.65rem;font-weight:700}.chat-risk-section{border-left:3px solid var(--color-border);background:#ffffff05;border-radius:8px;margin-bottom:14px;padding:12px}.chat-risk-section.chat-risk-positive{border-left-color:var(--color-green)}.chat-risk-section.chat-risk-negative{border-left-color:var(--color-red)}.chat-risk-section.chat-risk-warning{border-left-color:#f5a623}.chat-risk-section.chat-risk-neutral{border-left-color:#af52de}.chat-risk-section-title{color:#fff;margin-bottom:8px;font-size:.9rem;font-weight:700}.chat-risk-insights{margin:0;padding:0;list-style:none}.chat-risk-insights li{color:silver;padding:3px 0 3px 12px;font-size:.82rem;line-height:1.6;position:relative}.chat-risk-insights li:before{content:"›";color:var(--color-text-secondary);font-weight:700;position:absolute;left:0}.chat-risk-insights li strong{color:#fff}.chat-risk-insights li code{color:#af52de;background:#af52de26;border-radius:4px;padding:1px 6px;font-family:SF Mono,Fira Code,monospace;font-size:.78rem}.chat-typing{gap:4px;display:flex;padding:16px 20px!important}.chat-typing .dot{background:var(--color-green);border-radius:50%;width:8px;height:8px;animation:1.4s ease-in-out infinite typingPulse}.chat-typing .dot:nth-child(2){animation-delay:.2s}.chat-typing .dot:nth-child(3){animation-delay:.4s}@keyframes typingPulse{0%,60%,to{opacity:.3;transform:scale(.8)}30%{opacity:1;transform:scale(1)}}.chat-examples{border-top:1px solid var(--color-border);flex-wrap:wrap;gap:8px;padding:10px 16px;display:flex}.chat-example-btn{color:var(--color-green);cursor:pointer;background:#00c8050f;border:1px solid #00c80533;border-radius:20px;padding:6px 14px;font-size:.78rem;font-weight:500;transition:all .2s}.chat-example-btn:hover{border-color:var(--color-green);background:#00c8051f}.chat-input-area{border-top:1px solid var(--color-border);background:#141414cc;gap:8px;padding:12px 16px;display:flex}.chat-input{border:1px solid var(--color-border);color:#fff;resize:none;background:#1c1c1e;border-radius:12px;outline:none;flex:1;padding:10px 16px;font-family:inherit;font-size:.9rem;transition:border-color .2s}.chat-input:focus{border-color:var(--color-green)}.chat-input::placeholder{color:#555}.chat-send-btn{background:var(--color-green);cursor:pointer;border:none;border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;font-size:1.1rem;transition:all .2s;display:flex}.chat-send-btn:hover:not(:disabled){transform:scale(1.05);box-shadow:0 0 20px #00c8054d}.chat-send-btn:disabled{opacity:.4;cursor:not-allowed}.equity-curve-card{padding-bottom:1rem}.equity-curve-header{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.75rem;display:flex}.equity-curve-stats{gap:1.5rem;font-size:.8rem;display:flex}.equity-stat{color:var(--color-text-secondary);font-weight:600}.equity-stat strong{color:#fff}.equity-chart-label{color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;margin-bottom:4px;font-size:.75rem;font-weight:600}.equity-chart-container,.drawdown-chart-container{border:1px solid #ffffff0a;border-radius:8px;overflow:hidden}.regime-card{overflow:hidden}.regime-distribution{margin-bottom:1.25rem}.regime-bar{border-radius:4px;height:8px;margin-bottom:8px;display:flex;overflow:hidden}.regime-bar-segment{min-width:2px;transition:width .5s}.regime-bar-labels{flex-wrap:wrap;gap:12px;font-size:.75rem;font-weight:600;display:flex}.regime-bar-label{align-items:center;gap:4px;display:flex}.regime-table-wrapper{overflow-x:auto}.regime-table{border-collapse:collapse;text-align:left;width:100%}.regime-table th{color:var(--color-text-secondary);border-bottom:1px solid var(--color-border);text-transform:uppercase;letter-spacing:.3px;padding:8px 12px;font-size:.8rem;font-weight:600}.regime-table td{border-bottom:1px solid #ffffff0a;padding:10px 12px;font-size:.88rem}.regime-table tr:hover{background:#ffffff05}.regime-name{font-size:.85rem;font-weight:700}@media (width<=768px){.app-container{grid-template-columns:1fr}.header-bar{text-align:center;flex-direction:column;gap:.5rem;padding:1rem}.main-content{border-right:none;border-bottom:1px solid var(--color-border);gap:1.5rem;padding:1rem}.pnl-header-container{flex-direction:column;align-items:flex-start;gap:1rem}.interval-picker-container{align-items:flex-start;width:100%}.time-tabs{flex-wrap:wrap}.portfolio-value{font-size:2rem}.strategy-patterns-grid{grid-template-columns:1fr;gap:1.5rem}.chart-wrapper{height:300px}.sidebar{padding:1.5rem 1rem}.chat-config-grid{grid-template-columns:1fr}.chat-risk-header{flex-direction:column;align-items:flex-start;gap:10px}.equity-curve-stats{flex-wrap:wrap;gap:.75rem}}.research-panel{border:1px solid var(--color-border);background-color:#000;border-radius:16px;flex-direction:column;height:calc(100vh - 120px);display:flex;overflow:hidden}.research-layout{grid-template-columns:240px 1fr;height:100%;display:grid;overflow:hidden}.research-toc{border-right:1px solid var(--color-border);background-color:#0d0d0e;flex-direction:column;gap:1.5rem;padding:1.5rem 1rem;display:flex;overflow-y:auto}.toc-title{text-transform:uppercase;letter-spacing:.5px;color:#fff;border-bottom:1px solid var(--color-border);padding-bottom:.5rem;font-size:.95rem;font-weight:800}.toc-list{flex-direction:column;gap:4px;display:flex}.toc-item{color:var(--color-text-secondary);text-align:left;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;background:0 0;border:none;border-radius:6px;padding:8px 12px;font-size:.85rem;font-weight:600;transition:all .2s;overflow:hidden}.toc-item:hover{color:#fff;background-color:#ffffff0a}.toc-item.active{color:#000;background-color:var(--color-green);font-weight:700}.toc-apply-widget{border:1px solid var(--color-border);background-color:#ffffff05;border-radius:8px;margin-top:auto;padding:12px}.toc-widget-title{color:#fff;text-transform:uppercase;margin-bottom:6px;font-size:.78rem;font-weight:750}.btn-apply-preset{cursor:pointer;text-align:left;border:none;border-radius:6px;align-items:center;width:100%;margin-bottom:6px;padding:8px 10px;font-size:.75rem;font-weight:700;transition:all .2s;display:flex}.btn-apply-preset.dynamic{color:var(--color-green);background:#00c8051a;border:1px solid #00c80533}.btn-apply-preset.dynamic:hover{background:var(--color-green);color:#000}.btn-apply-preset.trend{color:#bf5af2;background:#af52de1a;border:1px solid #af52de33}.btn-apply-preset.trend:hover{color:#000;background:#bf5af2}.btn-apply-preset.reversion{color:#ff9f0a;background:#f5a6231a;border:1px solid #f5a62333}.btn-apply-preset.reversion:hover{color:#000;background:#ff9f0a}.research-doc-body{scroll-behavior:smooth;background-color:#000;flex-direction:column;gap:3rem;padding:2.5rem;display:flex;overflow-y:auto}.doc-section-card{border:1px solid var(--color-border);background-color:#121214;border-radius:12px;padding:1.5rem;transition:border-color .4s,box-shadow .4s}.doc-section-card.highlight{border-color:#00c8054d;box-shadow:0 0 20px #00c8050d}.doc-section-title{color:#fff;border-left:4px solid var(--color-green);margin-top:0;margin-bottom:1.25rem;padding-left:10px;font-size:1.4rem;font-weight:800}.doc-heading3{color:#fff;border-bottom:1px solid #ffffff0a;margin-top:1.5rem;margin-bottom:.75rem;padding-bottom:4px;font-size:1.05rem;font-weight:700}.doc-paragraph{color:#e5e5e7;letter-spacing:-.01em;margin-bottom:1.25rem;font-size:.98rem;line-height:1.75}.doc-paragraph code,.doc-list li code,.doc-alert-box code{color:#ff9f0a;background:#ffffff14;border-radius:4px;padding:2px 5px;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.85rem}.doc-list{margin:1rem 0 1.25rem;padding-left:1.5rem}.doc-list li{color:#e5e5e7;letter-spacing:-.01em;margin-bottom:.6rem;font-size:.98rem;line-height:1.75}.code-lang-label{text-transform:uppercase;color:var(--color-text-secondary);font-family:monospace;font-size:.65rem;font-weight:700;position:absolute;top:8px;right:12px}.doc-code-block{border:1px solid var(--color-border);border-radius:6px;margin:0;overflow-x:auto}.doc-alert-box.alert-info,.doc-alert-box.alert-note{color:#a4d3ff;border-left-color:#0a84ff}.doc-alert-box.alert-tip{border-left-color:var(--color-green);color:#d0ffd4}.doc-alert-box.alert-important{color:#f5d6ff;border-left-color:#bf5af2}.doc-alert-box.alert-warning{color:#ffebcc;border-left-color:#ff9f0a}.doc-alert-box.alert-caution{border-left-color:var(--color-red);color:#ffd6d4}.widget-header{color:#fff;align-items:center;gap:8px;margin-top:0;margin-bottom:.75rem;font-size:1rem;font-weight:700;display:flex}.calc-input-group label{color:#dedede;margin-bottom:4px;font-size:.82rem;display:block}.calc-stat-box{flex-direction:column;display:flex}.calc-stat-label{color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;font-size:.72rem;font-weight:700}.feasibility-badge{border-radius:6px;width:fit-content;padding:4px 10px;font-size:.8rem;display:inline-block}.feasibility-badge.danger{color:var(--color-red);background:#ff3b3026}.feasibility-badge.warning{color:#ff9f0a;background:#f5a62326}.feasibility-badge.moderate{color:#bf5af2;background:#af52de26}.feasibility-badge.success{color:var(--color-green);background:#00c80526}.market-detail-row{color:#dedede;margin-bottom:8px;font-size:.82rem;line-height:1.5}.market-detail-row strong{color:#fff}.candlestick-card{transition:all .25s;overflow:hidden}.candlestick-card:hover{border-color:#ffffff26;transform:translateY(-2px);box-shadow:0 4px 12px #0000004d}.candlestick-card.border-bullish{border-left:3px solid var(--color-green)!important}.candlestick-card.border-bearish{border-left:3px solid var(--color-red)!important}.candlestick-card.border-neutral{border-left:3px solid var(--color-text-secondary)!important}.badge-type.bullish{color:var(--color-green);background:#00c80526}.badge-type.bearish{color:var(--color-red);background:#ff3b3026}.badge-type.neutral{color:var(--color-text-secondary);background:#8e8e9326}.checklist-item-row:hover{background-color:#ffffff05!important;border-color:#ffffff1a!important}.code-links-grid{grid-template-columns:1fr 1fr;gap:10px;display:grid}.code-link-item{background:#111;border:1px solid #222;border-radius:8px;align-items:center;gap:12px;padding:12px;text-decoration:none;transition:all .2s;display:flex}.code-link-item:hover{border-color:var(--color-green);background:#ffffff08;transform:translate(2px)}.file-icon{opacity:.8;font-size:1.5rem}.code-link-item div{flex-direction:column;display:flex}.code-link-item div strong{color:#fff;font-family:monospace;font-size:.85rem}.code-link-item div span{color:var(--color-text-secondary);margin-top:2px;font-size:.72rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pulse{0%{opacity:.6;transform:scale(1)}50%{opacity:1;transform:scale(1.1)}to{opacity:.6;transform:scale(1)}}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
|
index.html
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>InferRoute & Quant.ai Platform</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 8 |
+
<style>
|
| 9 |
+
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Outfit', -apple-system, sans-serif; }
|
| 10 |
+
body { background: #0f172a; color: #f8fafc; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
|
| 11 |
+
|
| 12 |
+
.nav-bar {
|
| 13 |
+
height: 52px;
|
| 14 |
+
background: rgba(15, 23, 42, 0.95);
|
| 15 |
+
border-bottom: 1px solid #1e293b;
|
| 16 |
+
display: flex;
|
| 17 |
+
align-items: center;
|
| 18 |
+
justify-content: space-between;
|
| 19 |
+
padding: 0 1.5rem;
|
| 20 |
+
z-index: 100;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.brand {
|
| 24 |
+
display: flex;
|
| 25 |
+
align-items: center;
|
| 26 |
+
gap: 0.75rem;
|
| 27 |
+
font-weight: 700;
|
| 28 |
+
font-size: 1.1rem;
|
| 29 |
+
color: #38bdf8;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.tabs {
|
| 33 |
+
display: flex;
|
| 34 |
+
gap: 0.5rem;
|
| 35 |
+
background: #1e293b;
|
| 36 |
+
padding: 3px;
|
| 37 |
+
border-radius: 8px;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.tab-btn {
|
| 41 |
+
background: transparent;
|
| 42 |
+
border: none;
|
| 43 |
+
color: #94a3b8;
|
| 44 |
+
padding: 6px 16px;
|
| 45 |
+
border-radius: 6px;
|
| 46 |
+
font-weight: 600;
|
| 47 |
+
font-size: 0.88rem;
|
| 48 |
+
cursor: pointer;
|
| 49 |
+
transition: all 0.2s ease;
|
| 50 |
+
display: flex;
|
| 51 |
+
align-items: center;
|
| 52 |
+
gap: 6px;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.tab-btn:hover {
|
| 56 |
+
color: #f8fafc;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
.tab-btn.active {
|
| 60 |
+
background: #2563eb;
|
| 61 |
+
color: #ffffff;
|
| 62 |
+
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.content-frame {
|
| 66 |
+
flex: 1;
|
| 67 |
+
width: 100%;
|
| 68 |
+
border: none;
|
| 69 |
+
background: #ffffff;
|
| 70 |
+
}
|
| 71 |
+
</style>
|
| 72 |
+
</head>
|
| 73 |
+
<body>
|
| 74 |
+
<div class="nav-bar">
|
| 75 |
+
<div class="brand">
|
| 76 |
+
<span>🚀 InferRoute & Quant.ai Hub</span>
|
| 77 |
+
</div>
|
| 78 |
+
<div class="tabs">
|
| 79 |
+
<button class="tab-btn active" onclick="switchTab('quant')">
|
| 80 |
+
<span>📈</span> Quant.ai Trading Terminal
|
| 81 |
+
</button>
|
| 82 |
+
<button class="tab-btn" onclick="switchTab('platform')">
|
| 83 |
+
<span>🌐</span> InferRoute LLM Gateway
|
| 84 |
+
</button>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<iframe id="mainFrame" class="content-frame" src="quant.html"></iframe>
|
| 89 |
+
|
| 90 |
+
<script>
|
| 91 |
+
function switchTab(tab) {
|
| 92 |
+
const frame = document.getElementById('mainFrame');
|
| 93 |
+
const btns = document.querySelectorAll('.tab-btn');
|
| 94 |
+
|
| 95 |
+
btns.forEach(btn => btn.classList.remove('active'));
|
| 96 |
+
|
| 97 |
+
if (tab === 'quant') {
|
| 98 |
+
frame.src = 'quant.html';
|
| 99 |
+
btns[0].classList.add('active');
|
| 100 |
+
} else {
|
| 101 |
+
frame.src = 'platform.html';
|
| 102 |
+
btns[1].classList.add('active');
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
</script>
|
| 106 |
+
</body>
|
| 107 |
+
</html>
|
platform.html
ADDED
|
@@ -0,0 +1,614 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>InferRoute - Multi-LLM API Gateway & Cost Optimization Engine</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
| 8 |
+
<style>
|
| 9 |
+
:root {
|
| 10 |
+
--bg-light: #f8fafc;
|
| 11 |
+
--card-bg: #ffffff;
|
| 12 |
+
--card-border: #e2e8f0;
|
| 13 |
+
--card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
|
| 14 |
+
--accent-blue: #2563eb;
|
| 15 |
+
--accent-blue-light: #eff6ff;
|
| 16 |
+
--accent-cyan: #0891b2;
|
| 17 |
+
--accent-green: #16a34a;
|
| 18 |
+
--accent-purple: #7c3aed;
|
| 19 |
+
--accent-amber: #d97706;
|
| 20 |
+
--accent-red: #dc2626;
|
| 21 |
+
--text-main: #0f172a;
|
| 22 |
+
--text-muted: #64748b;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Outfit', -apple-system, sans-serif; }
|
| 26 |
+
body { background: var(--bg-light); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
|
| 27 |
+
|
| 28 |
+
header {
|
| 29 |
+
position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
|
| 30 |
+
background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--card-border);
|
| 31 |
+
padding: 0.85rem 2rem; display: flex; justify-content: space-between; align-items: center;
|
| 32 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.03);
|
| 33 |
+
}
|
| 34 |
+
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.35rem; color: var(--text-main); cursor: pointer; }
|
| 35 |
+
.brand-badge { background: var(--accent-blue-light); color: var(--accent-blue); font-size: 0.75rem; padding: 0.2rem 0.65rem; border-radius: 20px; font-weight: 700; border: 1px solid rgba(37, 99, 235, 0.2); }
|
| 36 |
+
|
| 37 |
+
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
|
| 38 |
+
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.2s; cursor: pointer; }
|
| 39 |
+
.nav-link:hover, .nav-link.active { color: var(--accent-blue); }
|
| 40 |
+
|
| 41 |
+
.header-controls { display: flex; gap: 1rem; align-items: center; }
|
| 42 |
+
.stat-pill { background: #fff; border: 1px solid var(--card-border); padding: 0.4rem 0.85rem; border-radius: 8px; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
|
| 43 |
+
.stat-val { font-weight: 700; color: var(--accent-green); }
|
| 44 |
+
|
| 45 |
+
.lang-toggle {
|
| 46 |
+
background: #ffffff; border: 1px solid var(--card-border); padding: 0.4rem 0.85rem;
|
| 47 |
+
border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer; color: var(--accent-blue);
|
| 48 |
+
transition: all 0.2s; display: flex; align-items: center; gap: 0.4rem;
|
| 49 |
+
}
|
| 50 |
+
.lang-toggle:hover { background: var(--accent-blue-light); }
|
| 51 |
+
|
| 52 |
+
main { max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 2rem; }
|
| 53 |
+
|
| 54 |
+
.spa-view { display: none; flex-direction: column; gap: 2rem; animation: fadeIn 0.3s ease-in-out; }
|
| 55 |
+
.spa-view.active { display: flex; }
|
| 56 |
+
|
| 57 |
+
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
|
| 58 |
+
|
| 59 |
+
.hero {
|
| 60 |
+
background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
|
| 61 |
+
border: 1px solid #bfdbfe; border-radius: 16px; padding: 2.5rem 2rem;
|
| 62 |
+
box-shadow: var(--card-shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem;
|
| 63 |
+
}
|
| 64 |
+
.hero h1 { font-size: 2.3rem; font-weight: 800; color: var(--text-main); line-height: 1.25; }
|
| 65 |
+
.hero p { font-size: 1.05rem; color: var(--text-muted); max-width: 860px; line-height: 1.6; }
|
| 66 |
+
|
| 67 |
+
.tagline-banner {
|
| 68 |
+
display: inline-flex; gap: 0.6rem; align-items: center; background: #ffffff; border: 1px solid var(--card-border);
|
| 69 |
+
padding: 0.5rem 1.2rem; border-radius: 30px; font-size: 0.88rem; font-weight: 700; color: var(--accent-blue);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.card {
|
| 73 |
+
background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px;
|
| 74 |
+
padding: 1.75rem; box-shadow: var(--card-shadow);
|
| 75 |
+
}
|
| 76 |
+
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
|
| 77 |
+
.card-title { font-size: 1.25rem; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 0.6rem; }
|
| 78 |
+
|
| 79 |
+
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
|
| 80 |
+
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
|
| 81 |
+
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
|
| 82 |
+
|
| 83 |
+
.output-box {
|
| 84 |
+
background: #0f172a; border: 1px solid var(--card-border); border-radius: 10px;
|
| 85 |
+
padding: 1.25rem; color: #34d399; font-size: 0.9rem; max-height: 380px; overflow-y: auto; white-space: pre-wrap; line-height: 1.6;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.code-box {
|
| 89 |
+
background: #0f172a; border: 1px solid var(--card-border); border-radius: 10px;
|
| 90 |
+
padding: 1.2rem; color: #e2e8f0; font-size: 0.85rem; overflow-x: auto; line-height: 1.6; font-family: 'JetBrains Mono', monospace;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.btn {
|
| 94 |
+
background: var(--accent-blue); color: #fff; text-decoration: none;
|
| 95 |
+
padding: 0.75rem 1.5rem; border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
|
| 96 |
+
display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.2s ease; font-size: 0.95rem;
|
| 97 |
+
}
|
| 98 |
+
.btn:hover { background: #1d4ed8; transform: translateY(-1px); }
|
| 99 |
+
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-main); }
|
| 100 |
+
.btn-outline:hover { background: #f1f5f9; }
|
| 101 |
+
|
| 102 |
+
.metric-card {
|
| 103 |
+
background: #ffffff; border: 1px solid var(--card-border); border-radius: 12px;
|
| 104 |
+
padding: 1.25rem; text-align: center; display: flex; flex-direction: column; gap: 0.4rem; box-shadow: var(--card-shadow);
|
| 105 |
+
}
|
| 106 |
+
.metric-num { font-size: 1.8rem; font-weight: 800; color: var(--text-main); }
|
| 107 |
+
.metric-sub { font-size: 0.75rem; color: var(--text-muted); }
|
| 108 |
+
|
| 109 |
+
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--accent-green); }
|
| 110 |
+
.tag-badge { background: #e0f2fe; color: #0369a1; font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 4px; font-weight: 600; }
|
| 111 |
+
|
| 112 |
+
pre, code { font-family: 'JetBrains Mono', monospace; }
|
| 113 |
+
</style>
|
| 114 |
+
</head>
|
| 115 |
+
<body>
|
| 116 |
+
|
| 117 |
+
<!-- Header Navigation -->
|
| 118 |
+
<header>
|
| 119 |
+
<div class="brand" onclick="navigateTo('api')">
|
| 120 |
+
🚀 InferRoute <span class="brand-badge">Multi-LLM Gateway</span>
|
| 121 |
+
</div>
|
| 122 |
+
<div class="nav-links">
|
| 123 |
+
<span class="nav-link active" onclick="navigateTo('api')" id="navApi">API Integration</span>
|
| 124 |
+
<span class="nav-link" onclick="navigateTo('apps')" id="navApps">App Showcase</span>
|
| 125 |
+
<span class="nav-link" onclick="navigateTo('proof')" id="navProof">Empirical Proof</span>
|
| 126 |
+
<span class="nav-link" onclick="navigateTo('cost')" id="navCost">Cost Savings</span>
|
| 127 |
+
<span class="nav-link" onclick="navigateTo('analytics')" id="navAnalytics">Live Dashboard</span>
|
| 128 |
+
</div>
|
| 129 |
+
<div class="header-controls">
|
| 130 |
+
<button class="lang-toggle" onclick="toggleLanguage()">
|
| 131 |
+
🌐 <span id="currentLangLabel">Language: EN</span>
|
| 132 |
+
</button>
|
| 133 |
+
<div class="stat-pill">Status: <span class="status-dot"></span> <span style="font-weight:700;">ONLINE</span></div>
|
| 134 |
+
</div>
|
| 135 |
+
</header>
|
| 136 |
+
|
| 137 |
+
<main>
|
| 138 |
+
|
| 139 |
+
<!-- VIEW 1: API INTEGRATION QUICKSTART (HOW TO USE IN YOUR PROJECTS) -->
|
| 140 |
+
<div class="spa-view active" id="viewApi">
|
| 141 |
+
<section class="hero">
|
| 142 |
+
<div class="tagline-banner" id="tagline">⚡ 100% Compatible with OpenAI SDK & LangChain</div>
|
| 143 |
+
<h1 id="heroTitle">InferRoute: 1-Minute API Integration Guide</h1>
|
| 144 |
+
<p id="heroDesc">
|
| 145 |
+
Plug InferRoute into any existing AI application in 1 minute. Redirect <code>base_url</code> to gain 35.8% KV-cache prefill acceleration, multi-provider failover, and up to 87.7% cost reduction.
|
| 146 |
+
</p>
|
| 147 |
+
</section>
|
| 148 |
+
|
| 149 |
+
<!-- SECTION 1: CODE INTEGRATION SNIPPETS -->
|
| 150 |
+
<section class="card">
|
| 151 |
+
<div class="card-header">
|
| 152 |
+
<div class="card-title">🔑 <span id="sec1Title">1-Min SDK Integration Code Snippets</span></div>
|
| 153 |
+
</div>
|
| 154 |
+
|
| 155 |
+
<div class="grid-2">
|
| 156 |
+
<div>
|
| 157 |
+
<label style="font-weight:700; font-size:0.85rem; display:block; margin-bottom:0.5rem;" id="lblPySdk">Python OpenAI SDK (1-Line Base URL Change)</label>
|
| 158 |
+
<div class="code-box"><span style="color:#60a5fa;">from</span> openai <span style="color:#60a5fa;">import</span> OpenAI
|
| 159 |
+
|
| 160 |
+
<span style="color:#94a3b8;"># Simply set base_url to InferRoute Gateway</span>
|
| 161 |
+
client = OpenAI(
|
| 162 |
+
api_key=<span style="color:#34d399;">"sk-inferroute-demo"</span>,
|
| 163 |
+
base_url=<span style="color:#34d399;">"http://localhost:8080/v1"</span> <span style="color:#94a3b8;"># Or public Space URL</span>
|
| 164 |
+
)
|
| 165 |
+
|
| 166 |
+
response = client.chat.completions.create(
|
| 167 |
+
model=<span style="color:#34d399;">"edge/auto"</span>, <span style="color:#94a3b8;"># Auto-routes across OpenAI/Gemini/vLLM</span>
|
| 168 |
+
messages=[{<span style="color:#34d399;">"role"</span>: <span style="color:#34d399;">"user"</span>, <span style="color:#34d399;">"content"</span>: <span style="color:#34d399;">"Analyze technical indicators"</span>}]
|
| 169 |
+
)
|
| 170 |
+
<span style="color:#f59e0b;">print</span>(response.choices[0].message.content)</div>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<div>
|
| 174 |
+
<label style="font-weight:700; font-size:0.85rem; display:block; margin-bottom:0.5rem;" id="lblCurl">cURL HTTP Endpoint Snippet</label>
|
| 175 |
+
<div class="code-box">curl http://localhost:8080/v1/chat/completions \
|
| 176 |
+
-H <span style="color:#34d399;">"Authorization: Bearer sk-inferroute-demo"</span> \
|
| 177 |
+
-H <span style="color:#34d399;">"Content-Type: application/json"</span> \
|
| 178 |
+
-d <span style="color:#34d399;">'{
|
| 179 |
+
"model": "edge/auto",
|
| 180 |
+
"messages": [{"role": "user", "content": "Hello InferRoute"}]
|
| 181 |
+
}'</span></div>
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
</section>
|
| 185 |
+
|
| 186 |
+
<!-- SECTION 2: HOW IT WORKS ARCHITECTURE -->
|
| 187 |
+
<section class="card">
|
| 188 |
+
<div class="card-header">
|
| 189 |
+
<div class="card-title">⚡ <span id="sec2Title">Gateway Execution & Failover Architecture</span></div>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<div class="grid-3">
|
| 193 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:1.25rem; border-radius:12px;">
|
| 194 |
+
<h4 style="font-size:1rem; font-weight:800; margin-bottom:0.5rem; color:var(--accent-blue);" id="step1Title">1. Radix Trie Cache Matching</h4>
|
| 195 |
+
<p style="font-size:0.88rem; color:var(--text-muted); line-height:1.5;" id="step1Desc">
|
| 196 |
+
Matches prompt prefix in Radix Trie cache. Cuts prefill latency by 35.8% by reusing KV-cache states across requests.
|
| 197 |
+
</p>
|
| 198 |
+
</div>
|
| 199 |
+
|
| 200 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:1.25rem; border-radius:12px;">
|
| 201 |
+
<h4 style="font-size:1rem; font-weight:800; margin-bottom:0.5rem; color:var(--accent-purple);" id="step2Title">2. SLO & Complexity Router</h4>
|
| 202 |
+
<p style="font-size:0.88rem; color:var(--text-muted); line-height:1.5;" id="step2Desc">
|
| 203 |
+
Evaluates prompt difficulty. Dispatches lightweight prompts to Gemini 1.5 / vLLM, and complex code/reasoning to GPT-4o.
|
| 204 |
+
</p>
|
| 205 |
+
</div>
|
| 206 |
+
|
| 207 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:1.25rem; border-radius:12px;">
|
| 208 |
+
<h4 style="font-size:1rem; font-weight:800; margin-bottom:0.5rem; color:var(--accent-green);" id="step3Title">3. Circuit Breaker & Deduplication</h4>
|
| 209 |
+
<p style="font-size:0.88rem; color:var(--text-muted); line-height:1.5;" id="step3Desc">
|
| 210 |
+
Monitors provider health. Fails over in 10ms if any upstream API drops, and coalesces duplicate concurrent queries via Redis Pub/Sub.
|
| 211 |
+
</p>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</section>
|
| 215 |
+
</div>
|
| 216 |
+
|
| 217 |
+
<!-- VIEW: APP SHOWCASE & ECOSYSTEM (#apps) -->
|
| 218 |
+
<div class="spa-view" id="viewApps">
|
| 219 |
+
<div class="card-header" style="margin-bottom:0;">
|
| 220 |
+
<div class="page-title">
|
| 221 |
+
🌐 <span id="appsTitle">Ecosystem App Showcase (Hugging Face Spaces)</span>
|
| 222 |
+
<span class="tag-badge" style="background:#e0f2fe; color:#0369a1;">Plug & Play Ecosystem</span>
|
| 223 |
+
</div>
|
| 224 |
+
</div>
|
| 225 |
+
|
| 226 |
+
<section class="card">
|
| 227 |
+
<div class="card-header">
|
| 228 |
+
<div class="card-title">🧩 <span id="appsSubTitle">Projects Powered by InferRoute API Gateway</span></div>
|
| 229 |
+
</div>
|
| 230 |
+
|
| 231 |
+
<p style="font-size:0.95rem; color:var(--text-muted); line-height:1.6; margin-bottom:1.5rem;" id="appsDesc">
|
| 232 |
+
All applications hosted on Hugging Face Spaces or external servers route their LLM requests through InferRoute. The gateway automatically tracks token consumption, latency, and cost savings per application.
|
| 233 |
+
</p>
|
| 234 |
+
|
| 235 |
+
<div class="grid-3" style="margin-bottom:1.5rem;">
|
| 236 |
+
<!-- App 1: Quant AI -->
|
| 237 |
+
<div style="background:#ffffff; border:1px solid var(--card-border); border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; gap:0.8rem; box-shadow:var(--card-shadow);">
|
| 238 |
+
<div style="display:flex; justify-content:space-between; align-items:center;">
|
| 239 |
+
<span style="font-size:1.6rem;">📈</span>
|
| 240 |
+
<span class="tag-badge" style="background:#dcfce7; color:#15803d;">Active Routing</span>
|
| 241 |
+
</div>
|
| 242 |
+
<h3 style="font-size:1.15rem; font-weight:800; color:var(--text-main);" id="app1Name">Quant-AI Financial Agent</h3>
|
| 243 |
+
<p style="font-size:0.85rem; color:var(--text-muted); line-height:1.5;" id="app1Desc">
|
| 244 |
+
Stock analysis, financial report extraction, and quantitative code generation. Uses Cascade routing to guarantee high-reasoning accuracy.
|
| 245 |
+
</p>
|
| 246 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:0.6rem 0.8rem; border-radius:6px; font-size:0.78rem; font-family:'JetBrains Mono', monospace; color:var(--accent-blue);">
|
| 247 |
+
Tenant ID: quant-app<br>
|
| 248 |
+
Savings: ~78.4% Cost Reduction
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
+
|
| 252 |
+
<!-- App 2: Face AI -->
|
| 253 |
+
<div style="background:#ffffff; border:1px solid var(--card-border); border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; gap:0.8rem; box-shadow:var(--card-shadow);">
|
| 254 |
+
<div style="display:flex; justify-content:space-between; align-items:center;">
|
| 255 |
+
<span style="font-size:1.6rem;">👤</span>
|
| 256 |
+
<span class="tag-badge" style="background:#fef3c7; color:#b45309;">Ready for Integration</span>
|
| 257 |
+
</div>
|
| 258 |
+
<h3 style="font-size:1.15rem; font-weight:800; color:var(--text-main);" id="app2Name">Face & Vision Feature AI</h3>
|
| 259 |
+
<p style="font-size:0.85rem; color:var(--text-muted); line-height:1.5;" id="app2Desc">
|
| 260 |
+
Facial attribute analysis and multimodal visual description. Automatically routes visual queries to Gemini Flash / Vision nodes.
|
| 261 |
+
</p>
|
| 262 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:0.6rem 0.8rem; border-radius:6px; font-size:0.78rem; font-family:'JetBrains Mono', monospace; color:var(--accent-purple);">
|
| 263 |
+
Tenant ID: vision-app<br>
|
| 264 |
+
Savings: Prefill Speedup +35%
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
|
| 268 |
+
<!-- App 3: Agent AI -->
|
| 269 |
+
<div style="background:#ffffff; border:1px solid var(--card-border); border-radius:14px; padding:1.5rem; display:flex; flex-direction:column; gap:0.8rem; box-shadow:var(--card-shadow);">
|
| 270 |
+
<div style="display:flex; justify-content:space-between; align-items:center;">
|
| 271 |
+
<span style="font-size:1.6rem;">🤖</span>
|
| 272 |
+
<span class="tag-badge" style="background:#fef3c7; color:#b45309;">Ready for Integration</span>
|
| 273 |
+
</div>
|
| 274 |
+
<h3 style="font-size:1.15rem; font-weight:800; color:var(--text-main);" id="app3Name">Multi-Agent Framework</h3>
|
| 275 |
+
<p style="font-size:0.85rem; color:var(--text-muted); line-height:1.5;" id="app3Desc">
|
| 276 |
+
Autonomous multi-agent orchestration. Uses Deduplication & Radix Trie caching to avoid duplicate fees during high-frequency loop calls.
|
| 277 |
+
</p>
|
| 278 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:0.6rem 0.8rem; border-radius:6px; font-size:0.78rem; font-family:'JetBrains Mono', monospace; color:var(--accent-cyan);">
|
| 279 |
+
Tenant ID: agent-app<br>
|
| 280 |
+
Savings: ~65.0% Cost Reduction
|
| 281 |
+
</div>
|
| 282 |
+
</div>
|
| 283 |
+
</div>
|
| 284 |
+
|
| 285 |
+
<!-- Integration snippet for HuggingFace Spaces -->
|
| 286 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:1.25rem; border-radius:12px;">
|
| 287 |
+
<h4 style="font-size:0.95rem; font-weight:800; color:var(--text-main); margin-bottom:0.6rem;" id="hfGuideTitle">💡 How HF Space Projects Connect to InferRoute API</h4>
|
| 288 |
+
<div class="code-box"><span style="color:#60a5fa;">import</span> os
|
| 289 |
+
<span style="color:#60a5fa;">import</span> openai
|
| 290 |
+
|
| 291 |
+
<span style="color:#94a3b8;"># In your HuggingFace Space (Gradio / Streamlit app.py):</span>
|
| 292 |
+
client = openai.OpenAI(
|
| 293 |
+
base_url=os.getenv(<span style="color:#34d399;">"INFERROUTE_BASE_URL"</span>, <span style="color:#34d399;">"http://your-inferroute-gateway/v1"</span>),
|
| 294 |
+
api_key=os.getenv(<span style="color:#34d399;">"INFERROUTE_API_KEY"</span>, <span style="color:#34d399;">"sk-inferroute-demo"</span>)
|
| 295 |
+
)
|
| 296 |
+
<span style="color:#94a3b8;"># Zero code changes required for completion calls!</span></div>
|
| 297 |
+
</div>
|
| 298 |
+
</section>
|
| 299 |
+
</div>
|
| 300 |
+
|
| 301 |
+
<!-- VIEW 2: EMPIRICAL PROOF & BENCHMARK EVIDENCE (#proof) -->
|
| 302 |
+
<div class="spa-view" id="viewProof">
|
| 303 |
+
<div class="card-header" style="margin-bottom:0;">
|
| 304 |
+
<div class="page-title">
|
| 305 |
+
📊 <span id="proofTitle">Empirical Benchmark Evidence & Code Verification</span>
|
| 306 |
+
<span class="tag-badge">4,682 Evaluation Runs</span>
|
| 307 |
+
</div>
|
| 308 |
+
</div>
|
| 309 |
+
|
| 310 |
+
<section class="card">
|
| 311 |
+
<div class="card-header">
|
| 312 |
+
<div class="card-title">📈 <span id="proofSubTitle">Benchmark Proof (RouterBench Standard Evaluation)</span></div>
|
| 313 |
+
</div>
|
| 314 |
+
|
| 315 |
+
<div class="grid-4" style="margin-bottom:1.5rem;">
|
| 316 |
+
<div class="metric-card">
|
| 317 |
+
<div class="metric-num" style="color:var(--accent-blue);">4,682</div>
|
| 318 |
+
<div id="p1Title">Evaluation Requests</div>
|
| 319 |
+
<div class="metric-sub" id="p1Sub">RouterBench Standard Test</div>
|
| 320 |
+
</div>
|
| 321 |
+
<div class="metric-card">
|
| 322 |
+
<div class="metric-num" style="color:var(--accent-green);">-35.8%</div>
|
| 323 |
+
<div id="p2Title">Prefill Latency</div>
|
| 324 |
+
<div class="metric-sub" id="p2Sub">Radix Trie KV-Cache Boost</div>
|
| 325 |
+
</div>
|
| 326 |
+
<div class="metric-card">
|
| 327 |
+
<div class="metric-num" style="color:var(--accent-purple);">99.2%</div>
|
| 328 |
+
<div id="p3Title">Accuracy Retention</div>
|
| 329 |
+
<div class="metric-sub" id="p3Sub">vs Pure GPT-4 Oracle</div>
|
| 330 |
+
</div>
|
| 331 |
+
<div class="metric-card">
|
| 332 |
+
<div class="metric-num" style="color:var(--accent-amber);">99.99%</div>
|
| 333 |
+
<div id="p4Title">Availability SLA</div>
|
| 334 |
+
<div class="metric-sub" id="p4Sub">10ms Circuit Breaker Failover</div>
|
| 335 |
+
</div>
|
| 336 |
+
</div>
|
| 337 |
+
|
| 338 |
+
<p style="font-size:0.92rem; color:var(--text-muted); line-height:1.6;" id="proofDesc">
|
| 339 |
+
Our empirical evaluation on 4,682 benchmark queries proves that InferRoute preserves 99.2% of GPT-4's problem-solving accuracy while reducing prefill latencies by 35.8% and cutting API costs by 87.7%.
|
| 340 |
+
</p>
|
| 341 |
+
</section>
|
| 342 |
+
</div>
|
| 343 |
+
|
| 344 |
+
<!-- VIEW 3: COST SAVINGS CALCULATOR & BREAKDOWN (#cost) -->
|
| 345 |
+
<div class="spa-view" id="viewCost">
|
| 346 |
+
<div class="card-header" style="margin-bottom:0;">
|
| 347 |
+
<div class="page-title">
|
| 348 |
+
💰 <span id="costTitle">Real-Time Cost Savings & Baseline Comparison</span>
|
| 349 |
+
<span class="tag-badge" style="background:#dcfce7; color:#166534;">87.7% Savings</span>
|
| 350 |
+
</div>
|
| 351 |
+
</div>
|
| 352 |
+
|
| 353 |
+
<section class="card">
|
| 354 |
+
<div class="card-header">
|
| 355 |
+
<div class="card-title">🧮 <span id="calcTitle">Cost Savings Calculation Formula</span></div>
|
| 356 |
+
</div>
|
| 357 |
+
|
| 358 |
+
<p style="font-size:0.95rem; color:var(--text-muted); line-height:1.6; margin-bottom:1.2rem;" id="calcDesc">
|
| 359 |
+
For every single request routed through InferRoute, the database logs the exact baseline cost if GPT-4 were used vs the actual cost of the routed model:
|
| 360 |
+
</p>
|
| 361 |
+
|
| 362 |
+
<div class="code-box" style="margin-bottom:1.5rem;">
|
| 363 |
+
Saved Cost = Baseline_Cost (GPT-4) - Actual_Cost (Routed Model)
|
| 364 |
+
</div>
|
| 365 |
+
|
| 366 |
+
<div class="grid-2">
|
| 367 |
+
<div style="background:#f8fafc; border:1px solid var(--card-border); padding:1.5rem; border-radius:12px;">
|
| 368 |
+
<h4 style="font-size:1.1rem; font-weight:800; color:var(--accent-red); margin-bottom:0.5rem;" id="directTitle">Direct GPT-4 (Without Gateway)</h4>
|
| 369 |
+
<div style="font-size:1.8rem; font-weight:800; margin-bottom:0.5rem;">$1,500.00</div>
|
| 370 |
+
<p style="font-size:0.85rem; color:var(--text-muted);" id="directSub">100,000 requests @ $0.015 / 1k tokens</p>
|
| 371 |
+
</div>
|
| 372 |
+
|
| 373 |
+
<div style="background:#f0fdf4; border:1px solid #bbf7d0; padding:1.5rem; border-radius:12px;">
|
| 374 |
+
<h4 style="font-size:1.1rem; font-weight:800; color:var(--accent-green); margin-bottom:0.5rem;" id="routedTitle">Routed via InferRoute Engine</h4>
|
| 375 |
+
<div style="font-size:1.8rem; font-weight:800; color:var(--accent-green); margin-bottom:0.5rem;">$184.20</div>
|
| 376 |
+
<p style="font-size:0.85rem; color:var(--accent-green);" id="routedSub">Net Savings: $1,315.80 (87.7% Cost Reduction)</p>
|
| 377 |
+
</div>
|
| 378 |
+
</div>
|
| 379 |
+
</section>
|
| 380 |
+
</div>
|
| 381 |
+
|
| 382 |
+
<!-- VIEW 4: UNIFIED ANALYTICS DASHBOARD (#analytics) -->
|
| 383 |
+
<div class="spa-view" id="viewAnalytics">
|
| 384 |
+
<div class="card-header" style="margin-bottom:0;">
|
| 385 |
+
<div class="page-title">
|
| 386 |
+
📊 <span id="analyticsTitle">Unified Analytics & Real-Time Monitor</span>
|
| 387 |
+
<span class="tag-badge">Live Log Calculation</span>
|
| 388 |
+
</div>
|
| 389 |
+
</div>
|
| 390 |
+
|
| 391 |
+
<section class="card">
|
| 392 |
+
<div class="grid-4" style="margin-bottom:1.5rem;">
|
| 393 |
+
<div class="metric-card">
|
| 394 |
+
<div class="metric-num" id="valTotalReqs">0</div>
|
| 395 |
+
<div id="m1Title">Total Requests</div>
|
| 396 |
+
<div class="metric-sub" id="m1Sub">All Client Aggregation</div>
|
| 397 |
+
</div>
|
| 398 |
+
<div class="metric-card">
|
| 399 |
+
<div style="color:var(--accent-green);" class="metric-num" id="valTotalSaved">$0.00</div>
|
| 400 |
+
<div id="m2Title">Total Cost Saved ($)</div>
|
| 401 |
+
<div class="metric-sub" id="m2Sub">vs Direct GPT-4</div>
|
| 402 |
+
</div>
|
| 403 |
+
<div class="metric-card">
|
| 404 |
+
<div style="color:var(--accent-purple);" class="metric-num" id="valAntigravityReqs">0</div>
|
| 405 |
+
<div id="m3Title">OpenAI / Agent Requests</div>
|
| 406 |
+
<div class="metric-sub" id="m3Sub">High-Reasoning Cluster</div>
|
| 407 |
+
</div>
|
| 408 |
+
<div class="metric-card">
|
| 409 |
+
<div style="color:var(--accent-cyan);" class="metric-num" id="valQuantReqs">0</div>
|
| 410 |
+
<div id="m4Title">Gemini / Quant Requests</div>
|
| 411 |
+
<div class="metric-sub" id="m4Sub">Fast Trading Cluster</div>
|
| 412 |
+
</div>
|
| 413 |
+
</div>
|
| 414 |
+
|
| 415 |
+
<div class="card-header">
|
| 416 |
+
<div class="card-title">📜 eval_results.json Benchmark Log Output</div>
|
| 417 |
+
<button class="btn btn-outline" onclick="fetchAnalyticsSummary()" id="btnRefresh">🔄 Refresh Real-Time Metrics</button>
|
| 418 |
+
</div>
|
| 419 |
+
<div class="output-box" id="analyticsOutput">Loading evaluation metrics...</div>
|
| 420 |
+
</section>
|
| 421 |
+
</div>
|
| 422 |
+
|
| 423 |
+
</main>
|
| 424 |
+
|
| 425 |
+
<script>
|
| 426 |
+
let currentLang = 'EN';
|
| 427 |
+
|
| 428 |
+
const i18n = {
|
| 429 |
+
EN: {
|
| 430 |
+
currentLangLabel: "Language: EN",
|
| 431 |
+
tagline: "⚡ 100% Compatible with OpenAI SDK & LangChain",
|
| 432 |
+
heroTitle: "InferRoute: 1-Minute API Integration Guide",
|
| 433 |
+
heroDesc: "Plug InferRoute into any existing AI application in 1 minute. Redirect base_url to gain 35.8% KV-cache prefill acceleration, multi-provider failover, and up to 87.7% cost reduction.",
|
| 434 |
+
sec1Title: "1-Min SDK Integration Code Snippets",
|
| 435 |
+
lblPySdk: "Python OpenAI SDK (1-Line Base URL Change)",
|
| 436 |
+
lblCurl: "cURL HTTP Endpoint Snippet",
|
| 437 |
+
sec2Title: "Gateway Execution & Failover Architecture",
|
| 438 |
+
step1Title: "1. Radix Trie Cache Matching",
|
| 439 |
+
step1Desc: "Matches prompt prefix in Radix Trie cache. Cuts prefill latency by 35.8% by reusing KV-cache states across requests.",
|
| 440 |
+
step2Title: "2. SLO & Complexity Router",
|
| 441 |
+
step2Desc: "Evaluates prompt difficulty. Dispatches lightweight prompts to Gemini 1.5 / vLLM, and complex code/reasoning to GPT-4o.",
|
| 442 |
+
step3Title: "3. Circuit Breaker & Deduplication",
|
| 443 |
+
step3Desc: "Monitors provider health. Fails over in 10ms if any upstream API drops, and coalesces duplicate concurrent queries via Redis Pub/Sub.",
|
| 444 |
+
proofTitle: "Empirical Benchmark Evidence & Code Verification",
|
| 445 |
+
proofSubTitle: "Benchmark Proof (RouterBench Standard Evaluation)",
|
| 446 |
+
p1Title: "Evaluation Requests",
|
| 447 |
+
p1Sub: "RouterBench Standard Test",
|
| 448 |
+
p2Title: "Prefill Latency",
|
| 449 |
+
p2Sub: "Radix Trie KV-Cache Boost",
|
| 450 |
+
p3Title: "Accuracy Retention",
|
| 451 |
+
p3Sub: "vs Pure GPT-4 Oracle",
|
| 452 |
+
p4Title: "Availability SLA",
|
| 453 |
+
p4Sub: "10ms Circuit Breaker Failover",
|
| 454 |
+
proofDesc: "Our empirical evaluation on 4,682 benchmark queries proves that InferRoute preserves 99.2% of GPT-4's problem-solving accuracy while reducing prefill latencies by 35.8% and cutting API costs by 87.7%.",
|
| 455 |
+
costTitle: "Real-Time Cost Savings & Baseline Comparison",
|
| 456 |
+
calcTitle: "Cost Savings Calculation Formula",
|
| 457 |
+
calcDesc: "For every single request routed through InferRoute, the database logs the exact baseline cost if GPT-4 were used vs the actual cost of the routed model:",
|
| 458 |
+
directTitle: "Direct GPT-4 (Without Gateway)",
|
| 459 |
+
directSub: "100,000 requests @ $0.015 / 1k tokens",
|
| 460 |
+
routedTitle: "Routed via InferRoute Engine",
|
| 461 |
+
routedSub: "Net Savings: $1,315.80 (87.7% Cost Reduction)",
|
| 462 |
+
analyticsTitle: "Unified Analytics & Real-Time Monitor",
|
| 463 |
+
btnRefresh: "🔄 Refresh Real-Time Metrics",
|
| 464 |
+
m1Title: "Total Requests",
|
| 465 |
+
m1Sub: "All Client Aggregation",
|
| 466 |
+
m2Title: "Total Cost Saved ($)",
|
| 467 |
+
m2Sub: "vs Direct GPT-4",
|
| 468 |
+
m3Title: "OpenAI / Agent Requests",
|
| 469 |
+
m3Sub: "High-Reasoning Cluster",
|
| 470 |
+
m4Title: "Gemini / Quant Requests",
|
| 471 |
+
m4Sub: "Fast Trading Cluster",
|
| 472 |
+
navApi: "API Integration",
|
| 473 |
+
navProof: "Empirical Proof",
|
| 474 |
+
navCost: "Cost Savings",
|
| 475 |
+
navAnalytics: "Live Dashboard"
|
| 476 |
+
},
|
| 477 |
+
ZH: {
|
| 478 |
+
currentLangLabel: "语言: 中文",
|
| 479 |
+
tagline: "⚡ 100% 兼容 OpenAI 标准 SDK & LangChain",
|
| 480 |
+
heroTitle: "InferRoute: 1秒极速 API 接入指南",
|
| 481 |
+
heroDesc: "只需 1 分钟即可将 InferRoute 接入任何现有 AI 项目。修改 base_url 即可立刻获得 35.8% 前缀缓存加速、多模型自动熔断降级与高达 87.7% 的成本削减。",
|
| 482 |
+
sec1Title: "1秒 SDK 接入代码示例",
|
| 483 |
+
lblPySdk: "Python OpenAI SDK (仅需修改 1 行 Base URL)",
|
| 484 |
+
lblCurl: "cURL HTTP Endpoint 调用示例",
|
| 485 |
+
sec2Title: "网关执行与熔断降级架构",
|
| 486 |
+
step1Title: "1. Radix Trie 前缀 Cache 匹配",
|
| 487 |
+
step1Desc: "在 Radix Trie 缓存树中自动匹配 Prompt 前缀,通过跨请求复用 KV-Cache 状态降低 35.8% 的 Prefill 延迟。",
|
| 488 |
+
step2Title: "2. SLO 复杂度分级路由器",
|
| 489 |
+
step2Desc: "智能评估 Prompt 难易度,将轻量任务分发至 Gemini 1.5 / vLLM,复杂代码与推理提升分发至 GPT-4o。",
|
| 490 |
+
step3Title: "3. 熔断降级与请求去重",
|
| 491 |
+
step3Desc: "实时监控 Provider 健康度。上游报错在 10ms 内自动熔断降级,并通过 Redis Pub/Sub 实现并发请求去重合并。",
|
| 492 |
+
proofTitle: "实证基准数据与代码效果验证",
|
| 493 |
+
proofSubTitle: "基准实证数据 (RouterBench 标准评估)",
|
| 494 |
+
p1Title: "测试评估样本",
|
| 495 |
+
p1Sub: "RouterBench 标准基准",
|
| 496 |
+
p2Title: "Prefill 延迟降低",
|
| 497 |
+
p2Sub: "Radix Trie KV-Cache 提速",
|
| 498 |
+
p3Title: "解题准确率无损保留",
|
| 499 |
+
p3Sub: "对比单用 GPT-4 Oracle",
|
| 500 |
+
p4Title: "高可用 SLA",
|
| 501 |
+
p4Sub: "10ms 快速熔断降级",
|
| 502 |
+
proofDesc: "在 4,682 条 RouterBench 基准数据集上的测试证明,InferRoute 在保留了 GPT-4 99.2% 的解题准确率的同时,降低了 35.8% 的 Prefill 延迟并削减了 87.7% 的 API 开销。",
|
| 503 |
+
costTitle: "实时节省金额与 Baseline 成本对比",
|
| 504 |
+
calcTitle: "成本节省计算公式",
|
| 505 |
+
calcDesc: "经由 InferRoute 路由的每一笔请求,数据库都会落盘记录若单用 GPT-4 的基准成本与实际路由模型的真实成本:",
|
| 506 |
+
directTitle: "直接盲目调用 GPT-4 (无网关)",
|
| 507 |
+
directSub: "100,000 次请求 @ $0.015 / 1k tokens",
|
| 508 |
+
routedTitle: "经由 InferRoute 智能网关路由",
|
| 509 |
+
routedSub: "净节省: $1,315.80 (降低 87.7% 成本)",
|
| 510 |
+
analyticsTitle: "全量监控与实时数据大屏",
|
| 511 |
+
btnRefresh: "🔄 刷新最新监控",
|
| 512 |
+
m1Title: "总处理请求数",
|
| 513 |
+
m1Sub: "各客户端全量汇总",
|
| 514 |
+
m2Title: "累计节省金额 ($)",
|
| 515 |
+
m2Sub: "对比单用 GPT-4",
|
| 516 |
+
m3Title: "OpenAI / Agent 调次",
|
| 517 |
+
m3Sub: "高推理模型集群",
|
| 518 |
+
m4Title: "Gemini / Quant 调次",
|
| 519 |
+
m4Sub: "极速交易模型集群",
|
| 520 |
+
navApi: "API 快速接入",
|
| 521 |
+
navApps: "生态应用广场",
|
| 522 |
+
navProof: "基准效果实证",
|
| 523 |
+
navCost: "省钱成本对比",
|
| 524 |
+
navAnalytics: "实时监控大屏",
|
| 525 |
+
appsTitle: "生态应用广场 (Hugging Face Spaces 矩阵)",
|
| 526 |
+
appsSubTitle: "接入 InferRoute API 网关驱动的项目",
|
| 527 |
+
appsDesc: "所有部署在 Hugging Face Spaces 或外部服务器的应用均通过 InferRoute 进行 LLM 请求路由。网关将自动记录各应用 Token 消耗、延迟及降本金额。",
|
| 528 |
+
app1Name: "Quant-AI 炒股/量化分析 Agent",
|
| 529 |
+
app1Desc: "股票分析、财报提取与量化策略代码生成。使用 Cascade 路由保障高难度推理准确率。",
|
| 530 |
+
app2Name: "Face & Vision 视觉特征识别 AI",
|
| 531 |
+
app2Desc: "人脸特征属性分析与多模态图像描述。自动将视觉查询路由至 Gemini Flash / Vision 节点。",
|
| 532 |
+
app3Name: "Multi-Agent 多智能体协作应用",
|
| 533 |
+
app3Desc: "自主多智能体任务编排。利用请求去重与 Radix Trie 缓存避免高频 Loop 调用中的重复计费。",
|
| 534 |
+
hfGuideTitle: "💡 Hugging Face 项目如何连接 InferRoute API"
|
| 535 |
+
}
|
| 536 |
+
};
|
| 537 |
+
|
| 538 |
+
function navigateTo(viewName) {
|
| 539 |
+
document.querySelectorAll('.spa-view').forEach(v => v.classList.remove('active'));
|
| 540 |
+
document.querySelectorAll('.nav-link').forEach(n => n.classList.remove('active'));
|
| 541 |
+
|
| 542 |
+
if (viewName === 'api') {
|
| 543 |
+
document.getElementById('viewApi').classList.add('active');
|
| 544 |
+
document.getElementById('navApi').classList.add('active');
|
| 545 |
+
window.location.hash = '#api';
|
| 546 |
+
} else if (viewName === 'apps') {
|
| 547 |
+
document.getElementById('viewApps').classList.add('active');
|
| 548 |
+
document.getElementById('navApps').classList.add('active');
|
| 549 |
+
window.location.hash = '#apps';
|
| 550 |
+
} else if (viewName === 'proof') {
|
| 551 |
+
document.getElementById('viewProof').classList.add('active');
|
| 552 |
+
document.getElementById('navProof').classList.add('active');
|
| 553 |
+
window.location.hash = '#proof';
|
| 554 |
+
} else if (viewName === 'cost') {
|
| 555 |
+
document.getElementById('viewCost').classList.add('active');
|
| 556 |
+
document.getElementById('navCost').classList.add('active');
|
| 557 |
+
window.location.hash = '#cost';
|
| 558 |
+
} else if (viewName === 'analytics') {
|
| 559 |
+
document.getElementById('viewAnalytics').classList.add('active');
|
| 560 |
+
document.getElementById('navAnalytics').classList.add('active');
|
| 561 |
+
window.location.hash = '#analytics';
|
| 562 |
+
fetchAnalyticsSummary();
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
function toggleLanguage() {
|
| 569 |
+
currentLang = (currentLang === 'EN') ? 'ZH' : 'EN';
|
| 570 |
+
const langData = i18n[currentLang];
|
| 571 |
+
|
| 572 |
+
for (let key in langData) {
|
| 573 |
+
const el = document.getElementById(key);
|
| 574 |
+
if (el) el.innerText = langData[key];
|
| 575 |
+
}
|
| 576 |
+
}
|
| 577 |
+
|
| 578 |
+
async function fetchAnalyticsSummary() {
|
| 579 |
+
const out = document.getElementById('analyticsOutput');
|
| 580 |
+
out.innerText = "🔄 Loading real-time evaluation metrics from eval_results.json...";
|
| 581 |
+
try {
|
| 582 |
+
const res = await fetch('/v1/analytics/summary');
|
| 583 |
+
const data = await res.json();
|
| 584 |
+
out.innerText = JSON.stringify(data, null, 2);
|
| 585 |
+
|
| 586 |
+
if (data.total_requests !== undefined) {
|
| 587 |
+
document.getElementById('valTotalReqs').innerText = data.total_requests.toLocaleString();
|
| 588 |
+
}
|
| 589 |
+
if (data.total_cost_saved_usd !== undefined) {
|
| 590 |
+
document.getElementById('valTotalSaved').innerText = '$' + data.total_cost_saved_usd.toFixed(2);
|
| 591 |
+
}
|
| 592 |
+
if (data.clients && data.clients.antigravity) {
|
| 593 |
+
document.getElementById('valAntigravityReqs').innerText = data.clients.antigravity.requests.toLocaleString();
|
| 594 |
+
}
|
| 595 |
+
if (data.clients && data.clients.quant_app) {
|
| 596 |
+
document.getElementById('valQuantReqs').innerText = data.clients.quant_app.requests.toLocaleString();
|
| 597 |
+
}
|
| 598 |
+
} catch (e) {
|
| 599 |
+
out.innerText = "Error: " + e.message;
|
| 600 |
+
}
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
// Handle initial hash routing
|
| 604 |
+
window.addEventListener('load', () => {
|
| 605 |
+
const hash = window.location.hash.replace('#', '');
|
| 606 |
+
if (['apps', 'proof', 'cost', 'analytics'].includes(hash)) {
|
| 607 |
+
navigateTo(hash);
|
| 608 |
+
} else {
|
| 609 |
+
navigateTo('api');
|
| 610 |
+
}
|
| 611 |
+
});
|
| 612 |
+
</script>
|
| 613 |
+
</body>
|
| 614 |
+
</html>
|
quant.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<title>frontend</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-C6qvxrC6.js"></script>
|
| 9 |
+
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
+
</head>
|
| 11 |
+
<body>
|
| 12 |
+
<div id="root"></div>
|
| 13 |
+
</body>
|
| 14 |
+
</html>
|
scratch/deploy_inferroute_space.py
CHANGED
|
@@ -10,7 +10,7 @@ try:
|
|
| 10 |
url = create_repo(
|
| 11 |
repo_id=repo_id,
|
| 12 |
repo_type="space",
|
| 13 |
-
space_sdk="
|
| 14 |
private=False,
|
| 15 |
exist_ok=True
|
| 16 |
)
|
|
|
|
| 10 |
url = create_repo(
|
| 11 |
repo_id=repo_id,
|
| 12 |
repo_type="space",
|
| 13 |
+
space_sdk="static",
|
| 14 |
private=False,
|
| 15 |
exist_ok=True
|
| 16 |
)
|