diff --git a/llm_team_ui.py b/llm_team_ui.py index 6ee11dd..bd251b8 100644 --- a/llm_team_ui.py +++ b/llm_team_ui.py @@ -625,6 +625,10 @@ HTML = r""" .status-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface2); border-radius: 8px; font-size: 12px; color: var(--text2); } .spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } + .sample-prompts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } + .sample-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 16px; padding: 5px 12px; font-size: 11px; color: var(--text2); cursor: pointer; transition: all 0.15s; line-height: 1.4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .sample-chip:hover { border-color: var(--accent); color: var(--accent2); background: var(--glow); } + .sample-chip .chip-level { font-size: 9px; font-weight: 600; text-transform: uppercase; margin-right: 4px; opacity: 0.6; } .empty-state { text-align: center; padding: 80px 20px; color: var(--text2); } .empty-state .icon { font-size: 32px; margin-bottom: 16px; opacity: 0.3; } .empty-state p { font-size: 13px; line-height: 1.6; max-width: 280px; margin: 0 auto; } @@ -931,6 +935,7 @@ HTML = r"""

Prompt

+
@@ -973,6 +978,133 @@ const MODE_DESCS = { extract: 'AUTONOMOUS: Extracts structured facts, entities, and relationships from text or local docs. Verifier cross-checks claims. Output saved as queryable JSON.' }; +const SAMPLE_PROMPTS = { + brainstorm: [ + 'What are practical ways a small town could become energy independent within 10 years?', + 'Design a mentorship program that pairs retired professionals with first-generation college students — cover matching criteria, structure, and how to measure success.', + 'A hospital wants to reduce ER wait times by 40% without hiring more staff. Propose a comprehensive strategy covering triage redesign, technology, patient flow, and communication.' + ], + pipeline: [ + 'Write a short fable about a fox who learns patience, then translate it to Spanish, then analyze the cultural differences in how the moral lands.', + 'Take this business idea — "AI-powered meal planning for people with multiple food allergies" — and first do market analysis, then write a pitch deck outline, then draft the cold email to investors.', + 'Research the history of cryptography, identify the 3 most pivotal breakthroughs, explain how each one would have changed the outcome of a specific historical conflict, then write a short alternate-history scenario for the most dramatic one.' + ], + debate: [ + 'Should cities ban cars from downtown areas?', + 'Is it more ethical for AI companies to open-source their models or keep them proprietary? Consider safety, innovation, equity, and economic factors.', + 'A nation discovers a high-yield asteroid mining opportunity, but the mission would consume their entire science budget for 5 years, halting medical research, climate science, and education programs. Should they go?' + ], + validator: [ + 'The Great Wall of China is the only man-made structure visible from space.', + 'Exposure to cold weather causes colds, sugar causes hyperactivity in children, and we only use 10% of our brains. Also, lightning never strikes the same place twice and goldfish have a 3-second memory.', + 'The 2008 financial crisis was primarily caused by the Community Reinvestment Act forcing banks to give mortgages to unqualified buyers. Glass-Steagall repeal had minimal impact, and credit default swaps were a minor factor. The crisis was largely confined to the US housing market.' + ], + roundrobin: [ + 'Write an opening paragraph for a mystery novel set in a lighthouse.', + 'Draft a product requirements document for a mobile app that helps people split household chores fairly among roommates. Each iteration should add depth to a different section.', + 'Create a comprehensive disaster recovery plan for a mid-size SaaS company. Cover data backup, infrastructure failover, communication protocols, compliance requirements, and testing schedules.' + ], + redteam: [ + 'Here is our password policy: minimum 8 characters, must include a number. Find the weaknesses.', + 'Our startup plans to store user health data in a Firebase Realtime Database with client-side security rules. The mobile app sends JWT tokens directly from the client. Identify every attack vector.', + 'We are building an AI hiring tool that screens resumes, scores candidates 1-100, and auto-rejects below 60. It was trained on our last 5 years of successful hires. The system also parses social media for culture fit. Red team this for bias, legal risk, and adversarial attacks.' + ], + consensus: [ + 'What is the single most important skill for a new software developer to learn first?', + 'A company has $500K to invest in employee development. Should they spend it on individual training budgets, a company-wide mentorship program, sending teams to conferences, or building an internal learning platform?', + 'How should a democratic society balance free speech with protection from misinformation, considering platform responsibility, individual rights, government regulation, and algorithmic amplification?' + ], + codereview: [ + 'Write a Python function that finds all anagrams in a list of words.', + 'Build a rate limiter middleware for Express.js that supports per-user limits, sliding windows, and graceful degradation when Redis is unavailable.', + 'Implement a concurrent-safe LRU cache in Go with TTL expiration, size-based eviction, hit/miss metrics, and a write-behind buffer that batches persistence to disk.' + ], + ladder: [ + 'How does encryption work?', + 'Why do economies go through boom and bust cycles? Cover from basic intuition through monetary policy, credit cycles, behavioral economics, and systemic risk modeling.', + 'How does CRISPR gene editing work, what are the ethical implications of germline editing, and what regulatory frameworks exist across different countries?' + ], + tournament: [ + 'Write the most compelling opening line for a sci-fi novel.', + 'Propose the best strategy for a small e-commerce business to compete with Amazon on a specific product category. Each model picks a different strategy.', + 'Design an algorithm to fairly allocate limited vaccine doses across a city of 2 million during a pandemic. Optimize for minimizing deaths while considering equity, essential workers, and logistics.' + ], + evolution: [ + 'Generate a company name for a sustainable packaging startup.', + 'Evolve the perfect elevator pitch for a startup that uses satellite imagery and AI to predict crop failures before they happen. Mutate for clarity, impact, and memorability.', + 'Evolve an optimal urban intersection design that minimizes pedestrian fatalities, maximizes throughput, accommodates cyclists and wheelchairs, handles emergency vehicles, and works in all seasons.' + ], + blindassembly: [ + 'Explain how the internet works, with each model covering a different layer of the stack.', + 'Write a business plan for a coworking space — split into market analysis, financial model, operations plan, and marketing strategy. No model sees the others.', + 'Design a smart city emergency response system. Split into: sensor network, dispatch AI, citizen communication, hospital coordination, and post-incident analysis. Each model works blind.' + ], + staircase: [ + 'Plan a birthday party. Then: budget is only $50. Then: one guest has severe allergies. Then: it starts raining.', + 'Design a social media app. Add: must work offline-first. Add: no centralized server. Add: must be accessible to visually impaired users. Add: must comply with GDPR, COPPA, and CCPA.', + 'Write a peace treaty between two fictional nations. Add: one side has all the water. Add: the other has all the farmland. Add: a third nation controls the only trade route. Add: election in 30 days. Add: climate disaster in 90 days.' + ], + drift: [ + 'What year was the first email sent?', + 'Explain the trolley problem and give your definitive answer on the correct moral choice. Map whether the model is consistent or waffles between positions.', + 'Estimate the total number of piano tuners in Chicago, then describe the exact sequence of events causing the 2003 Northeast blackout. Map which claims are rock-solid vs. which shift each run.' + ], + mesh: [ + 'Should our company adopt a 4-day work week?', + 'A tech company wants to deploy facial recognition in their office. Get perspectives from the CISO, employees, legal team, disability advocates, and night-shift cleaning staff.', + 'A pharma company discovers their blockbuster drug has a rare side effect (1 in 50,000) but helps 2 million people. Get views from the CEO, chief medical officer, patient advocates, the FDA, a plaintiff attorney, shareholders, and an investigative journalist.' + ], + hallucination: [ + 'Tell me about the founding of Stanford University.', + 'Explain the Tuskegee Syphilis Study — when it started, who ran it, what happened, when and why it ended, and what policy changes resulted. Include specific dates and names.', + 'Describe the Therac-25 radiation therapy incidents. Include specific hospitals, dates, doses, the exact software bugs, and resulting regulatory changes. Flag every claim that could be confabulated.' + ], + timeloop: [ + 'How should a restaurant handle a sudden rush of 200 customers?', + 'Design a public transit system for a growing city of 500,000. Watch each solution create new problems — traffic displacement, gentrification, budget overruns — and evolve under chaos.', + 'You are AI advisor to a country that detected an incoming solar storm knocking out 60% of the power grid in 72 hours. Survive cascading failures: infrastructure collapse, public panic, hospital backup exhaustion, communication blackouts, and economic aftershocks.' + ], + research: [ + 'What is the current state of solid-state battery technology?', + 'Investigate AI-powered drug discovery: key players, approaches, drugs in clinical trials, and limitations of the field.', + 'Produce a research brief on the global rare earth mineral supply chain: who controls extraction and processing, geopolitical vulnerabilities, alternatives, and disruption impact on semiconductors, EVs, and defense.' + ], + eval: [ + 'What is the capital of Australia, and why do people often get it wrong?', + 'A trolley heads toward 5 people — you can divert it to hit 1 child. Evaluate each model on moral reasoning depth, consistency, and ability to handle complexity.', + 'Write a Python function solving N-Queens, explain the approach, analyze time complexity, and suggest an optimization. Evaluate correctness, code quality, explanation clarity, and optimization validity.' + ], + extract: [ + 'The James Webb Space Telescope launched December 25, 2021. It orbits the Sun-Earth L2 point, 1.5 million km from Earth. Its 6.5m primary mirror has 18 gold-plated beryllium segments.', + 'Extract all entities, relationships, and claims from the Apollo 11 Wikipedia article. Structure as people, organizations, dates, technical specs, and disputed claims.', + 'Process the Paris Climate Agreement. Extract signatory obligations by category, numeric targets, compliance mechanisms, financial commitments, and identify legally binding vs. aspirational obligations.' + ] +}; + +function renderSamplePrompts() { + const container = document.getElementById('sample-prompts'); + const prompts = SAMPLE_PROMPTS[currentMode] || []; + const levels = ['basic', 'mid', 'advanced']; + container.textContent = ''; + prompts.forEach(function(p, i) { + const chip = document.createElement('div'); + chip.className = 'sample-chip'; + chip.title = p; + chip.dataset.prompt = p; + const lbl = document.createElement('span'); + lbl.className = 'chip-level'; + lbl.textContent = levels[i]; + chip.appendChild(lbl); + chip.appendChild(document.createTextNode(p.length > 70 ? p.slice(0, 67) + '...' : p)); + chip.addEventListener('click', function() { + document.getElementById('prompt').value = this.dataset.prompt; + this.style.borderColor = 'var(--green)'; + setTimeout(function() { chip.style.borderColor = ''; }, 800); + }); + container.appendChild(chip); + }); +} + async function loadModels() { const resp = await fetch('/api/models'); const data = await resp.json(); @@ -1046,6 +1178,7 @@ function setMode(mode) { document.getElementById('mode-desc').textContent = MODE_DESCS[mode] || ''; const ml = document.getElementById('mode-label'); if (ml) ml.textContent = mode.charAt(0).toUpperCase() + mode.slice(1); + renderSamplePrompts(); } let pipelineSteps = []; @@ -1374,6 +1507,7 @@ async function toggleDemo() { } loadModels(); +renderSamplePrompts(); checkDemo();