[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A6C3W0M7ZD4V9P2TGE3AMX":3,"skill-same:01M7A6C3W0M7ZD4V9P2TGE3AMX":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M7A6C3W0M7ZD4V9P2TGE3AMX","llm-council",null,"Run Fireworks-hosted open-weight model councils that compare responses and synthesize a final answer.","MHassan0000\u002FSkills","MHassan0000","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F224296448?v=4","01M7A14DTC1EZCRN04582533RD","Muhammad Hassan Yousaf","01M7A14DV10KTW8NHQTJPD08X0",1,"MIT","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fllm-council\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: llm-council\ndescription: \"Run Fireworks-hosted open-weight model councils that compare responses and synthesize a final answer.\"\nallowed-tools: Read, Write, Bash, AskUserQuestion\ncategory: \"ai-agents\"\nrisk: \"safe\"\nsource: \"official\"\nsource_repo: \"dair-ai\u002Fdair-academy-plugins\"\nsource_type: \"official\"\ndate_added: \"2026-06-19\"\nauthor: \"DAIR.AI\"\nlicense: \"MIT\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002Fdair-ai\u002Fdair-academy-plugins\u002Fblob\u002Fmain\u002FREADME.md#license\"\ntags:\n  - dair-academy\n  - ai\n  - workflow\ntools:\n  - claude-code\n  - codex-cli\n  - cursor\n---\n\n# LLM Council (Fireworks AI)\n\n## When to Use\n\nUse when this workflow matches the user request: Use this skill for its documented workflow.\n\n\n_Source: [dair-ai\u002Fdair-academy-plugins](https:\u002F\u002Fgithub.com\u002Fdair-ai\u002Fdair-academy-plugins) (MIT)._\n\nThis skill implements Karpathy's LLM Council concept where multiple open-weight LLMs deliberate on a query, powered entirely by Fireworks AI:\n\n1. **Phase 1**: All models respond to the query independently (parallel)\n2. **Phase 2**: Models rank each other's anonymized responses\n3. **Phase 3**: A Chairman LLM synthesizes the final answer\n\nAll inference runs through **Fireworks AI** using open-weight models. The speed and pricing of Fireworks makes it practical to run multi-model deliberation that would be slow or expensive on other providers.\n\n## CRITICAL RULES\n\n1. **ALWAYS use AskUserQuestion** to let the user select council models (multiselect) and the Chairman model\n2. **ALWAYS save raw responses to files** - never summarize or truncate API outputs\n3. **ALWAYS show full transparency** - display all individual responses, all rankings, AND the final synthesis\n4. **NEVER skip the ranking phase** - it is essential to the council deliberation process\n5. **Read from files for display** - ensures content is shown unmodified\n6. **ALWAYS display the final output to the user** after Phase 3 completes\n\n## Pre-flight Check\n\nBefore running any phase, verify the Fireworks API key is set:\n\n```bash\nif [ -z \"$FIREWORKS_API_KEY\" ]; then\n  echo \"ERROR: FIREWORKS_API_KEY is not set.\"\n  echo \"Create a Fireworks AI account at: https:\u002F\u002Ffireworks.ai\u002F\"\n  echo \"Then export it in your shell profile (~\u002F.zshrc or ~\u002F.bashrc):\"\n  echo '  read -rsp \"Fireworks API key: \" FIREWORKS_API_KEY; echo; export FIREWORKS_API_KEY'\n  exit 1\nfi\necho \"FIREWORKS_API_KEY is set.\"\n```\n\n## Available Models\n\nPresent these options to the user via AskUserQuestion (multiselect):\n\n| Model | Fireworks ID | Provider |\n|-------|-------------|----------|\n| GLM 5 | accounts\u002Ffireworks\u002Fmodels\u002Fglm-5 | Z.ai |\n| DeepSeek V3.1 | accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p1 | DeepSeek |\n| DeepSeek V3.2 | accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p2 | DeepSeek |\n| MiniMax M2.1 | accounts\u002Ffireworks\u002Fmodels\u002Fminimax-m2p1 | MiniMax |\n| Kimi K2.5 | accounts\u002Ffireworks\u002Fmodels\u002Fkimi-k2p5 | Moonshot |\n| Qwen3 235B | accounts\u002Ffireworks\u002Fmodels\u002Fqwen3-235b-a22b | Alibaba |\n| Llama 4 Maverick | accounts\u002Ffireworks\u002Fmodels\u002Fllama4-maverick-instruct-basic | Meta |\n\n## Workflow\n\n### Step 1: Gather User Input\n\nUse AskUserQuestion to get:\n1. The query\u002Fquestion for the council (or accept it from the conversation)\n2. Which models to include (multiselect, recommend 3-5 models)\n3. Which model should be the Chairman (single select)\n\nNote: AskUserQuestion supports max 4 options per question. Since there are 7 models, split model selection across two questions, or show the most popular 4 and let the user type \"Other\" for the rest. A good default is to show 4 models in the first question and note the others are available via \"Other\". Rotate which models are shown based on variety.\n\nExample AskUserQuestion for model selection (show 4, mention others):\n```\nquestion: \"Which models should participate in the LLM Council? (Also available via Other: Llama 4 Maverick, Qwen3 235B, GLM 5)\"\nheader: \"Models\"\nmultiSelect: true\noptions:\n  - label: \"DeepSeek V3.2\"\n    description: \"DeepSeek's newest and most capable model\"\n  - label: \"MiniMax M2.1\"\n    description: \"MiniMax's strong open-weight model\"\n  - label: \"Kimi K2.5\"\n    description: \"Moonshot's strong open-weight model\"\n  - label: \"DeepSeek V3.1\"\n    description: \"DeepSeek's proven reasoning model\"\n```\n\nExample AskUserQuestion for chairman:\n```\nquestion: \"Which model should be the Chairman (synthesizes the final answer)?\"\nheader: \"Chairman\"\nmultiSelect: false\noptions:\n  - label: \"DeepSeek V3.2 (Recommended)\"\n    description: \"Newest DeepSeek, strong at comprehensive analysis\"\n  - label: \"GLM 5\"\n    description: \"Strong reasoning for synthesis\"\n  - label: \"Kimi K2.5\"\n    description: \"Strong at structured synthesis\"\n  - label: \"MiniMax M2.1\"\n    description: \"Strong open-weight model for synthesis\"\n```\n\n### Model Name to ID Mapping\n\nUse this mapping to convert user selections to Fireworks model IDs:\n\n```python\nMODEL_MAP = {\n    \"GLM 5\": \"accounts\u002Ffireworks\u002Fmodels\u002Fglm-5\",\n    \"DeepSeek V3.1\": \"accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p1\",\n    \"DeepSeek V3.2\": \"accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p2\",\n    \"MiniMax M2.1\": \"accounts\u002Ffireworks\u002Fmodels\u002Fminimax-m2p1\",\n    \"Kimi K2.5\": \"accounts\u002Ffireworks\u002Fmodels\u002Fkimi-k2p5\",\n    \"Qwen3 235B\": \"accounts\u002Ffireworks\u002Fmodels\u002Fqwen3-235b-a22b\",\n    \"Llama 4 Maverick\": \"accounts\u002Ffireworks\u002Fmodels\u002Fllama4-maverick-instruct-basic\",\n}\n```\n\n### Step 2: Run Phase 1 - Individual Responses\n\nAfter gathering input, run this script to get responses from all selected models in parallel:\n\n```bash\nQUERY=\"USER_QUERY_HERE\"\nMODELS='[\"accounts\u002Ffireworks\u002Fmodels\u002Fglm-5\", \"accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p1\"]'\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nimport requests\nimport time\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nFIREWORKS_API_KEY = os.environ.get(\"FIREWORKS_API_KEY\")\nAPI_URL = \"https:\u002F\u002Fapi.fireworks.ai\u002Finference\u002Fv1\u002Fchat\u002Fcompletions\"\n\nQUERY = os.environ.get(\"QUERY\", \"\")\nMODELS = json.loads(os.environ.get(\"MODELS\", \"[]\"))\n\n# Create session directory\ntimestamp = time.strftime(\"%Y%m%d-%H%M%S\")\nSESSION_DIR = f\"\u002Ftmp\u002Fllm-council\u002F{timestamp}\"\nos.makedirs(SESSION_DIR, exist_ok=True)\n\n# Save config\nconfig = {\"query\": QUERY, \"models\": MODELS, \"timestamp\": timestamp}\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\", \"w\") as f:\n    json.dump(config, f, indent=2)\n\ndef call_model(model_id, query):\n    \"\"\"Call a single model via Fireworks AI\"\"\"\n    try:\n        start = time.time()\n        response = requests.post(\n            API_URL,\n            headers={\n                \"Authorization\": f\"Bearer {FIREWORKS_API_KEY}\",\n                \"Content-Type\": \"application\u002Fjson\"\n            },\n            json={\n                \"model\": model_id,\n                \"messages\": [\n                    {\"role\": \"system\", \"content\": \"You are participating in an LLM council deliberation. Provide your best, most thoughtful response to the query. Be comprehensive but focused.\"},\n                    {\"role\": \"user\", \"content\": query}\n                ],\n                \"max_tokens\": 4000,\n                \"temperature\": 1\n            },\n            timeout=120\n        )\n        response.raise_for_status()\n        elapsed = time.time() - start\n        data = response.json()\n        usage = data.get(\"usage\", {})\n        return {\n            \"success\": True,\n            \"content\": data[\"choices\"][0][\"message\"][\"content\"],\n            \"model\": model_id,\n            \"latency_seconds\": round(elapsed, 2),\n            \"tokens\": {\n                \"prompt\": usage.get(\"prompt_tokens\", 0),\n                \"completion\": usage.get(\"completion_tokens\", 0),\n                \"total\": usage.get(\"total_tokens\", 0)\n            }\n        }\n    except Exception as e:\n        return {\n            \"success\": False,\n            \"content\": f\"[ERROR: {str(e)}]\",\n            \"model\": model_id,\n            \"latency_seconds\": 0,\n            \"tokens\": {\"prompt\": 0, \"completion\": 0, \"total\": 0}\n        }\n\nprint(f\"\\n{'='*60}\")\nprint(\"PHASE 1: Collecting Individual Responses\")\nprint(f\"{'='*60}\")\nprint(f\"Query: {QUERY[:200]}...\")\nprint(f\"Models: {', '.join([m.split('\u002F')[-1] for m in MODELS])}\")\nprint(f\"Session: {SESSION_DIR}\")\nprint()\n\n# Parallel execution\nresults = {}\nwith ThreadPoolExecutor(max_workers=len(MODELS)) as executor:\n    futures = {executor.submit(call_model, m, QUERY): m for m in MODELS}\n    for future in as_completed(futures):\n        model = futures[future]\n        result = future.result()\n        results[model] = result\n        status = \"OK\" if result[\"success\"] else \"FAILED\"\n        latency = f\"{result['latency_seconds']}s\" if result[\"success\"] else \"N\u002FA\"\n        print(f\"  [{status}] {model.split('\u002F')[-1]} ({latency})\")\n\n# Save raw results\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\", \"w\") as f:\n    json.dump(results, f, indent=2)\n\nprint(f\"\\nPhase 1 complete. Results saved to: {SESSION_DIR}\u002Fphase1_responses.json\")\nprint(f\"SESSION_DIR={SESSION_DIR}\")\nPYEOF\n```\n\n### Step 3: Run Phase 2 - Cross-Model Ranking\n\nEach model reviews and ranks the anonymized responses from Phase 1:\n\n```bash\nSESSION_DIR=\"\u002Ftmp\u002Fllm-council\u002FTIMESTAMP_HERE\"\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nimport requests\nimport time\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nFIREWORKS_API_KEY = os.environ.get(\"FIREWORKS_API_KEY\")\nAPI_URL = \"https:\u002F\u002Fapi.fireworks.ai\u002Finference\u002Fv1\u002Fchat\u002Fcompletions\"\nSESSION_DIR = os.environ.get(\"SESSION_DIR\")\n\n# Load Phase 1 results\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\") as f:\n    config = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\") as f:\n    phase1_results = json.load(f)\n\nQUERY = config[\"query\"]\nMODELS = config[\"models\"]\n\n# Create anonymized mapping\nlabels = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\"][:len(MODELS)]\nmodel_to_label = dict(zip(MODELS, labels))\nlabel_to_model = {v: k for k, v in model_to_label.items()}\n\n# Format anonymized responses\nanonymized_responses = []\nfor model_id in MODELS:\n    label = model_to_label[model_id]\n    content = phase1_results[model_id][\"content\"]\n    anonymized_responses.append(f\"=== Response {label} ===\\n{content}\")\n\nanonymized_text = \"\\n\\n\".join(anonymized_responses)\n\ndef get_rankings(model_id, query, anonymized, own_label):\n    \"\"\"Get rankings from a single model\"\"\"\n    ranking_prompt = f\"\"\"You are evaluating responses from multiple AI models to this query:\n\nQUERY: {query}\n\nHere are the anonymized responses:\n\n{anonymized}\n\nPlease rank these responses from BEST to WORST. For each ranking:\n1. State the response letter (A, B, C, etc.)\n2. Give a brief reason (1-2 sentences)\n3. You may skip ranking your own response (labeled {own_label}) or rank it fairly\n\nFormat your response EXACTLY as:\nRANKINGS:\n1. [Letter] - [Brief reason]\n2. [Letter] - [Brief reason]\n3. [Letter] - [Brief reason]\n...\"\"\"\n\n    try:\n        start = time.time()\n        response = requests.post(\n            API_URL,\n            headers={\n                \"Authorization\": f\"Bearer {FIREWORKS_API_KEY}\",\n                \"Content-Type\": \"application\u002Fjson\"\n            },\n            json={\n                \"model\": model_id,\n                \"messages\": [\n                    {\"role\": \"system\", \"content\": f\"You are ranking AI responses objectively. Your own response is labeled '{own_label}'.\"},\n                    {\"role\": \"user\", \"content\": ranking_prompt}\n                ],\n                \"max_tokens\": 1000,\n                \"temperature\": 1\n            },\n            timeout=90\n        )\n        response.raise_for_status()\n        elapsed = time.time() - start\n        return {\n            \"success\": True,\n            \"content\": response.json()[\"choices\"][0][\"message\"][\"content\"],\n            \"model\": model_id,\n            \"latency_seconds\": round(elapsed, 2)\n        }\n    except Exception as e:\n        return {\n            \"success\": False,\n            \"content\": f\"[ERROR: {str(e)}]\",\n            \"model\": model_id,\n            \"latency_seconds\": 0\n        }\n\nprint(f\"\\n{'='*60}\")\nprint(\"PHASE 2: Cross-Model Ranking\")\nprint(f\"{'='*60}\")\nprint(f\"Label mapping: {json.dumps({v: k.split('\u002F')[-1] for k, v in model_to_label.items()})}\")\nprint()\n\n# Collect rankings from all models in parallel\nrankings = {}\nwith ThreadPoolExecutor(max_workers=len(MODELS)) as executor:\n    futures = {\n        executor.submit(get_rankings, mid, QUERY, anonymized_text, model_to_label[mid]): mid\n        for mid in MODELS\n    }\n    for future in as_completed(futures):\n        model = futures[future]\n        result = future.result()\n        rankings[model] = result\n        status = \"OK\" if result[\"success\"] else \"FAILED\"\n        latency = f\"{result['latency_seconds']}s\" if result[\"success\"] else \"N\u002FA\"\n        print(f\"  [{status}] {model.split('\u002F')[-1]} ({latency})\")\n\n# Save rankings\noutput = {\n    \"label_mapping\": label_to_model,\n    \"model_to_label\": model_to_label,\n    \"rankings\": rankings\n}\nwith open(f\"{SESSION_DIR}\u002Fphase2_rankings.json\", \"w\") as f:\n    json.dump(output, f, indent=2)\n\nprint(f\"\\nPhase 2 complete. Rankings saved to: {SESSION_DIR}\u002Fphase2_rankings.json\")\nPYEOF\n```\n\n### Step 4: Run Phase 3 - Chairman Synthesis\n\nThe Chairman model receives all responses and rankings, then produces the final synthesis:\n\n```bash\nSESSION_DIR=\"\u002Ftmp\u002Fllm-council\u002FTIMESTAMP_HERE\"\nCHAIRMAN_MODEL=\"accounts\u002Ffireworks\u002Fmodels\u002Fglm-5\"\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nimport requests\nimport time\n\nFIREWORKS_API_KEY = os.environ.get(\"FIREWORKS_API_KEY\")\nAPI_URL = \"https:\u002F\u002Fapi.fireworks.ai\u002Finference\u002Fv1\u002Fchat\u002Fcompletions\"\nSESSION_DIR = os.environ.get(\"SESSION_DIR\")\nCHAIRMAN_MODEL = os.environ.get(\"CHAIRMAN_MODEL\")\n\n# Load all previous results\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\") as f:\n    config = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\") as f:\n    phase1 = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase2_rankings.json\") as f:\n    phase2 = json.load(f)\n\nQUERY = config[\"query\"]\nlabel_to_model = phase2[\"label_mapping\"]\nmodel_to_label = phase2[\"model_to_label\"]\n\n# Format responses with model names revealed\nresponses_text = []\nfor model_id, result in phase1.items():\n    label = model_to_label.get(model_id, \"?\")\n    model_name = model_id.split(\"\u002F\")[-1]\n    responses_text.append(f\"=== {label}: {model_name} ===\\n{result['content']}\")\n\n# Format rankings\nrankings_text = []\nfor model_id, result in phase2[\"rankings\"].items():\n    model_name = model_id.split(\"\u002F\")[-1]\n    rankings_text.append(f\"[{model_name}'s Rankings]\\n{result['content']}\")\n\nsynthesis_prompt = f\"\"\"You are the Chairman of an LLM Council. Your task is to synthesize the best possible answer from multiple AI responses.\n\nORIGINAL QUERY:\n{QUERY}\n\nINDIVIDUAL RESPONSES:\n{chr(10).join(responses_text)}\n\nMODEL RANKINGS:\n{chr(10).join(rankings_text)}\n\nAs Chairman, produce a FINAL SYNTHESIS that:\n1. Incorporates the strongest elements from the best-ranked responses\n2. Resolves any contradictions between responses\n3. Addresses aspects that multiple models agreed on\n4. Corrects any errors identified through cross-ranking\n5. Provides the most complete, accurate, and helpful answer\n\nBegin your synthesis:\"\"\"\n\nprint(f\"\\n{'='*60}\")\nprint(\"PHASE 3: Chairman Synthesis\")\nprint(f\"{'='*60}\")\nprint(f\"Chairman: {CHAIRMAN_MODEL.split('\u002F')[-1]}\")\nprint()\n\ntry:\n    start = time.time()\n    response = requests.post(\n        API_URL,\n        headers={\n            \"Authorization\": f\"Bearer {FIREWORKS_API_KEY}\",\n            \"Content-Type\": \"application\u002Fjson\"\n        },\n        json={\n            \"model\": CHAIRMAN_MODEL,\n            \"messages\": [\n                {\"role\": \"system\", \"content\": \"You are the Chairman of an LLM Council. Synthesize multiple AI perspectives into a definitive, comprehensive response.\"},\n                {\"role\": \"user\", \"content\": synthesis_prompt}\n            ],\n            \"max_tokens\": 4000,\n            \"temperature\": 1\n        },\n        timeout=180\n    )\n    response.raise_for_status()\n    elapsed = time.time() - start\n    synthesis = response.json()[\"choices\"][0][\"message\"][\"content\"]\n\n    with open(f\"{SESSION_DIR}\u002Fphase3_synthesis.txt\", \"w\") as f:\n        f.write(synthesis)\n\n    print(f\"Phase 3 complete ({elapsed:.2f}s). Synthesis saved to: {SESSION_DIR}\u002Fphase3_synthesis.txt\")\n\nexcept Exception as e:\n    print(f\"ERROR: {e}\")\n    synthesis = f\"[ERROR: {str(e)}]\"\n    with open(f\"{SESSION_DIR}\u002Fphase3_synthesis.txt\", \"w\") as f:\n        f.write(synthesis)\n\n# Update config with chairman\nconfig[\"chairman\"] = CHAIRMAN_MODEL\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\", \"w\") as f:\n    json.dump(config, f, indent=2)\nPYEOF\n```\n\n### Step 5: Display Full Results\n\nRead all saved files and display the complete council deliberation:\n\n```bash\nSESSION_DIR=\"\u002Ftmp\u002Fllm-council\u002FTIMESTAMP_HERE\"\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\n\nSESSION_DIR = os.environ.get(\"SESSION_DIR\")\n\n# Load all data\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\") as f:\n    config = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\") as f:\n    phase1 = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase2_rankings.json\") as f:\n    phase2 = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase3_synthesis.txt\") as f:\n    synthesis = f.read()\n\nmodel_to_label = phase2[\"model_to_label\"]\nlabel_to_model = phase2[\"label_mapping\"]\n\n# Build formatted output\noutput = []\noutput.append(\"=\" * 70)\noutput.append(\"                  LLM COUNCIL DELIBERATION\")\noutput.append(\"                  Powered by Fireworks AI\")\noutput.append(\"=\" * 70)\noutput.append(\"\")\noutput.append(f\"QUERY: {config['query']}\")\noutput.append(f\"COUNCIL: {', '.join([m.split('\u002F')[-1] for m in config['models']])}\")\noutput.append(f\"CHAIRMAN: {config.get('chairman', 'N\u002FA').split('\u002F')[-1]}\")\noutput.append(\"\")\n\n# Phase 1: Individual Responses\noutput.append(\"-\" * 70)\noutput.append(\"                 PHASE 1: INDIVIDUAL RESPONSES\")\noutput.append(\"-\" * 70)\noutput.append(\"\")\n\nfor model_id, result in phase1.items():\n    model_name = model_id.split(\"\u002F\")[-1]\n    label = model_to_label.get(model_id, \"?\")\n    latency = result.get(\"latency_seconds\", \"N\u002FA\")\n    tokens = result.get(\"tokens\", {})\n    output.append(f\"[{label}] {model_name} (latency: {latency}s, tokens: {tokens.get('total', 'N\u002FA')})\")\n    output.append(\"-\" * 40)\n    output.append(result[\"content\"])\n    output.append(\"\")\n\n# Phase 2: Cross-Model Rankings\noutput.append(\"-\" * 70)\noutput.append(\"                 PHASE 2: CROSS-MODEL RANKINGS\")\noutput.append(\"-\" * 70)\noutput.append(\"\")\noutput.append(f\"Label mapping: {json.dumps({v: k.split('\u002F')[-1] for k, v in model_to_label.items()}, indent=2)}\")\noutput.append(\"\")\n\nfor model_id, result in phase2[\"rankings\"].items():\n    model_name = model_id.split(\"\u002F\")[-1]\n    output.append(f\"[{model_name}'s Rankings]\")\n    output.append(result[\"content\"])\n    output.append(\"\")\n\n# Phase 3: Chairman Synthesis\noutput.append(\"-\" * 70)\noutput.append(\"                 PHASE 3: CHAIRMAN'S SYNTHESIS\")\noutput.append(\"-\" * 70)\noutput.append(\"\")\nchairman_name = config.get(\"chairman\", \"Chairman\").split(\"\u002F\")[-1]\noutput.append(f\"[{chairman_name} - Chairman]\")\noutput.append(\"\")\noutput.append(synthesis)\noutput.append(\"\")\noutput.append(\"=\" * 70)\noutput.append(f\"Session files: {SESSION_DIR}\u002F\")\n\n# Save formatted output\nfinal_output = \"\\n\".join(output)\nwith open(f\"{SESSION_DIR}\u002Ffinal_output.md\", \"w\") as f:\n    f.write(final_output)\n\nprint(final_output)\nprint(f\"\\nFull output saved to: {SESSION_DIR}\u002Ffinal_output.md\")\nPYEOF\n```\n\n## Important Notes\n\n1. **Session Directory**: Each run creates a unique session in `\u002Ftmp\u002Fllm-council\u002F{timestamp}\u002F`\n2. **Raw Data Preserved**: All API responses are saved as-is to JSON files for full transparency\n3. **Cost**: Fireworks pricing is per-token. More models and longer queries cost more. Check current pricing at https:\u002F\u002Ffireworks.ai\u002Fpricing\n4. **Latency Tracking**: Each API call tracks latency so you can see Fireworks' speed in action\n5. **Token Usage**: Phase 1 responses include token counts for cost awareness\n6. **Rate Limits**: If you hit rate limits, wait briefly and retry\n7. **Model Availability**: Check https:\u002F\u002Fapp.fireworks.ai\u002F for current model status\n\n## Setup\n\n1. Create a Fireworks AI account at https:\u002F\u002Ffireworks.ai\u002F and grab your API key from the dashboard\n2. Export it in your shell profile:\n   ```bash\n   read -rsp \"Fireworks API key: \" FIREWORKS_API_KEY\n   echo\n   export FIREWORKS_API_KEY\n   ```\n3. Restart your terminal or run `source ~\u002F.zshrc`\n4. Invoke this skill when you want multiple open-weight AI perspectives on a question\n\n\n## Limitations\n\n- Requires the upstream tool, account, API key, or local setup when the workflow names one.\n- Does not authorize destructive, production, paid, or external-message actions without explicit user approval.\n- Validate generated artifacts or recommendations against the user's real sources before treating them as final.\n","# LLM Council (Fireworks AI)\n\n## When to Use\n\nUse when this workflow matches the user request: Use this skill for its documented workflow.\n\n\n_Source: [dair-ai\u002Fdair-academy-plugins](https:\u002F\u002Fgithub.com\u002Fdair-ai\u002Fdair-academy-plugins) (MIT)._\n\nThis skill implements Karpathy's LLM Council concept where multiple open-weight LLMs deliberate on a query, powered entirely by Fireworks AI:\n\n1. **Phase 1**: All models respond to the query independently (parallel)\n2. **Phase 2**: Models rank each other's anonymized responses\n3. **Phase 3**: A Chairman LLM synthesizes the final answer\n\nAll inference runs through **Fireworks AI** using open-weight models. The speed and pricing of Fireworks makes it practical to run multi-model deliberation that would be slow or expensive on other providers.\n\n## CRITICAL RULES\n\n1. **ALWAYS use AskUserQuestion** to let the user select council models (multiselect) and the Chairman model\n2. **ALWAYS save raw responses to files** - never summarize or truncate API outputs\n3. **ALWAYS show full transparency** - display all individual responses, all rankings, AND the final synthesis\n4. **NEVER skip the ranking phase** - it is essential to the council deliberation process\n5. **Read from files for display** - ensures content is shown unmodified\n6. **ALWAYS display the final output to the user** after Phase 3 completes\n\n## Pre-flight Check\n\nBefore running any phase, verify the Fireworks API key is set:\n\n```bash\nif [ -z \"$FIREWORKS_API_KEY\" ]; then\n  echo \"ERROR: FIREWORKS_API_KEY is not set.\"\n  echo \"Create a Fireworks AI account at: https:\u002F\u002Ffireworks.ai\u002F\"\n  echo \"Then export it in your shell profile (~\u002F.zshrc or ~\u002F.bashrc):\"\n  echo '  read -rsp \"Fireworks API key: \" FIREWORKS_API_KEY; echo; export FIREWORKS_API_KEY'\n  exit 1\nfi\necho \"FIREWORKS_API_KEY is set.\"\n```\n\n## Available Models\n\nPresent these options to the user via AskUserQuestion (multiselect):\n\n| Model | Fireworks ID | Provider |\n|-------|-------------|----------|\n| GLM 5 | accounts\u002Ffireworks\u002Fmodels\u002Fglm-5 | Z.ai |\n| DeepSeek V3.1 | accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p1 | DeepSeek |\n| DeepSeek V3.2 | accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p2 | DeepSeek |\n| MiniMax M2.1 | accounts\u002Ffireworks\u002Fmodels\u002Fminimax-m2p1 | MiniMax |\n| Kimi K2.5 | accounts\u002Ffireworks\u002Fmodels\u002Fkimi-k2p5 | Moonshot |\n| Qwen3 235B | accounts\u002Ffireworks\u002Fmodels\u002Fqwen3-235b-a22b | Alibaba |\n| Llama 4 Maverick | accounts\u002Ffireworks\u002Fmodels\u002Fllama4-maverick-instruct-basic | Meta |\n\n## Workflow\n\n### Step 1: Gather User Input\n\nUse AskUserQuestion to get:\n1. The query\u002Fquestion for the council (or accept it from the conversation)\n2. Which models to include (multiselect, recommend 3-5 models)\n3. Which model should be the Chairman (single select)\n\nNote: AskUserQuestion supports max 4 options per question. Since there are 7 models, split model selection across two questions, or show the most popular 4 and let the user type \"Other\" for the rest. A good default is to show 4 models in the first question and note the others are available via \"Other\". Rotate which models are shown based on variety.\n\nExample AskUserQuestion for model selection (show 4, mention others):\n```\nquestion: \"Which models should participate in the LLM Council? (Also available via Other: Llama 4 Maverick, Qwen3 235B, GLM 5)\"\nheader: \"Models\"\nmultiSelect: true\noptions:\n  - label: \"DeepSeek V3.2\"\n    description: \"DeepSeek's newest and most capable model\"\n  - label: \"MiniMax M2.1\"\n    description: \"MiniMax's strong open-weight model\"\n  - label: \"Kimi K2.5\"\n    description: \"Moonshot's strong open-weight model\"\n  - label: \"DeepSeek V3.1\"\n    description: \"DeepSeek's proven reasoning model\"\n```\n\nExample AskUserQuestion for chairman:\n```\nquestion: \"Which model should be the Chairman (synthesizes the final answer)?\"\nheader: \"Chairman\"\nmultiSelect: false\noptions:\n  - label: \"DeepSeek V3.2 (Recommended)\"\n    description: \"Newest DeepSeek, strong at comprehensive analysis\"\n  - label: \"GLM 5\"\n    description: \"Strong reasoning for synthesis\"\n  - label: \"Kimi K2.5\"\n    description: \"Strong at structured synthesis\"\n  - label: \"MiniMax M2.1\"\n    description: \"Strong open-weight model for synthesis\"\n```\n\n### Model Name to ID Mapping\n\nUse this mapping to convert user selections to Fireworks model IDs:\n\n```python\nMODEL_MAP = {\n    \"GLM 5\": \"accounts\u002Ffireworks\u002Fmodels\u002Fglm-5\",\n    \"DeepSeek V3.1\": \"accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p1\",\n    \"DeepSeek V3.2\": \"accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p2\",\n    \"MiniMax M2.1\": \"accounts\u002Ffireworks\u002Fmodels\u002Fminimax-m2p1\",\n    \"Kimi K2.5\": \"accounts\u002Ffireworks\u002Fmodels\u002Fkimi-k2p5\",\n    \"Qwen3 235B\": \"accounts\u002Ffireworks\u002Fmodels\u002Fqwen3-235b-a22b\",\n    \"Llama 4 Maverick\": \"accounts\u002Ffireworks\u002Fmodels\u002Fllama4-maverick-instruct-basic\",\n}\n```\n\n### Step 2: Run Phase 1 - Individual Responses\n\nAfter gathering input, run this script to get responses from all selected models in parallel:\n\n```bash\nQUERY=\"USER_QUERY_HERE\"\nMODELS='[\"accounts\u002Ffireworks\u002Fmodels\u002Fglm-5\", \"accounts\u002Ffireworks\u002Fmodels\u002Fdeepseek-v3p1\"]'\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nimport requests\nimport time\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nFIREWORKS_API_KEY = os.environ.get(\"FIREWORKS_API_KEY\")\nAPI_URL = \"https:\u002F\u002Fapi.fireworks.ai\u002Finference\u002Fv1\u002Fchat\u002Fcompletions\"\n\nQUERY = os.environ.get(\"QUERY\", \"\")\nMODELS = json.loads(os.environ.get(\"MODELS\", \"[]\"))\n\n# Create session directory\ntimestamp = time.strftime(\"%Y%m%d-%H%M%S\")\nSESSION_DIR = f\"\u002Ftmp\u002Fllm-council\u002F{timestamp}\"\nos.makedirs(SESSION_DIR, exist_ok=True)\n\n# Save config\nconfig = {\"query\": QUERY, \"models\": MODELS, \"timestamp\": timestamp}\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\", \"w\") as f:\n    json.dump(config, f, indent=2)\n\ndef call_model(model_id, query):\n    \"\"\"Call a single model via Fireworks AI\"\"\"\n    try:\n        start = time.time()\n        response = requests.post(\n            API_URL,\n            headers={\n                \"Authorization\": f\"Bearer {FIREWORKS_API_KEY}\",\n                \"Content-Type\": \"application\u002Fjson\"\n            },\n            json={\n                \"model\": model_id,\n                \"messages\": [\n                    {\"role\": \"system\", \"content\": \"You are participating in an LLM council deliberation. Provide your best, most thoughtful response to the query. Be comprehensive but focused.\"},\n                    {\"role\": \"user\", \"content\": query}\n                ],\n                \"max_tokens\": 4000,\n                \"temperature\": 1\n            },\n            timeout=120\n        )\n        response.raise_for_status()\n        elapsed = time.time() - start\n        data = response.json()\n        usage = data.get(\"usage\", {})\n        return {\n            \"success\": True,\n            \"content\": data[\"choices\"][0][\"message\"][\"content\"],\n            \"model\": model_id,\n            \"latency_seconds\": round(elapsed, 2),\n            \"tokens\": {\n                \"prompt\": usage.get(\"prompt_tokens\", 0),\n                \"completion\": usage.get(\"completion_tokens\", 0),\n                \"total\": usage.get(\"total_tokens\", 0)\n            }\n        }\n    except Exception as e:\n        return {\n            \"success\": False,\n            \"content\": f\"[ERROR: {str(e)}]\",\n            \"model\": model_id,\n            \"latency_seconds\": 0,\n            \"tokens\": {\"prompt\": 0, \"completion\": 0, \"total\": 0}\n        }\n\nprint(f\"\\n{'='*60}\")\nprint(\"PHASE 1: Collecting Individual Responses\")\nprint(f\"{'='*60}\")\nprint(f\"Query: {QUERY[:200]}...\")\nprint(f\"Models: {', '.join([m.split('\u002F')[-1] for m in MODELS])}\")\nprint(f\"Session: {SESSION_DIR}\")\nprint()\n\n# Parallel execution\nresults = {}\nwith ThreadPoolExecutor(max_workers=len(MODELS)) as executor:\n    futures = {executor.submit(call_model, m, QUERY): m for m in MODELS}\n    for future in as_completed(futures):\n        model = futures[future]\n        result = future.result()\n        results[model] = result\n        status = \"OK\" if result[\"success\"] else \"FAILED\"\n        latency = f\"{result['latency_seconds']}s\" if result[\"success\"] else \"N\u002FA\"\n        print(f\"  [{status}] {model.split('\u002F')[-1]} ({latency})\")\n\n# Save raw results\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\", \"w\") as f:\n    json.dump(results, f, indent=2)\n\nprint(f\"\\nPhase 1 complete. Results saved to: {SESSION_DIR}\u002Fphase1_responses.json\")\nprint(f\"SESSION_DIR={SESSION_DIR}\")\nPYEOF\n```\n\n### Step 3: Run Phase 2 - Cross-Model Ranking\n\nEach model reviews and ranks the anonymized responses from Phase 1:\n\n```bash\nSESSION_DIR=\"\u002Ftmp\u002Fllm-council\u002FTIMESTAMP_HERE\"\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nimport requests\nimport time\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nFIREWORKS_API_KEY = os.environ.get(\"FIREWORKS_API_KEY\")\nAPI_URL = \"https:\u002F\u002Fapi.fireworks.ai\u002Finference\u002Fv1\u002Fchat\u002Fcompletions\"\nSESSION_DIR = os.environ.get(\"SESSION_DIR\")\n\n# Load Phase 1 results\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\") as f:\n    config = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\") as f:\n    phase1_results = json.load(f)\n\nQUERY = config[\"query\"]\nMODELS = config[\"models\"]\n\n# Create anonymized mapping\nlabels = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\"][:len(MODELS)]\nmodel_to_label = dict(zip(MODELS, labels))\nlabel_to_model = {v: k for k, v in model_to_label.items()}\n\n# Format anonymized responses\nanonymized_responses = []\nfor model_id in MODELS:\n    label = model_to_label[model_id]\n    content = phase1_results[model_id][\"content\"]\n    anonymized_responses.append(f\"=== Response {label} ===\\n{content}\")\n\nanonymized_text = \"\\n\\n\".join(anonymized_responses)\n\ndef get_rankings(model_id, query, anonymized, own_label):\n    \"\"\"Get rankings from a single model\"\"\"\n    ranking_prompt = f\"\"\"You are evaluating responses from multiple AI models to this query:\n\nQUERY: {query}\n\nHere are the anonymized responses:\n\n{anonymized}\n\nPlease rank these responses from BEST to WORST. For each ranking:\n1. State the response letter (A, B, C, etc.)\n2. Give a brief reason (1-2 sentences)\n3. You may skip ranking your own response (labeled {own_label}) or rank it fairly\n\nFormat your response EXACTLY as:\nRANKINGS:\n1. [Letter] - [Brief reason]\n2. [Letter] - [Brief reason]\n3. [Letter] - [Brief reason]\n...\"\"\"\n\n    try:\n        start = time.time()\n        response = requests.post(\n            API_URL,\n            headers={\n                \"Authorization\": f\"Bearer {FIREWORKS_API_KEY}\",\n                \"Content-Type\": \"application\u002Fjson\"\n            },\n            json={\n                \"model\": model_id,\n                \"messages\": [\n                    {\"role\": \"system\", \"content\": f\"You are ranking AI responses objectively. Your own response is labeled '{own_label}'.\"},\n                    {\"role\": \"user\", \"content\": ranking_prompt}\n                ],\n                \"max_tokens\": 1000,\n                \"temperature\": 1\n            },\n            timeout=90\n        )\n        response.raise_for_status()\n        elapsed = time.time() - start\n        return {\n            \"success\": True,\n            \"content\": response.json()[\"choices\"][0][\"message\"][\"content\"],\n            \"model\": model_id,\n            \"latency_seconds\": round(elapsed, 2)\n        }\n    except Exception as e:\n        return {\n            \"success\": False,\n            \"content\": f\"[ERROR: {str(e)}]\",\n            \"model\": model_id,\n            \"latency_seconds\": 0\n        }\n\nprint(f\"\\n{'='*60}\")\nprint(\"PHASE 2: Cross-Model Ranking\")\nprint(f\"{'='*60}\")\nprint(f\"Label mapping: {json.dumps({v: k.split('\u002F')[-1] for k, v in model_to_label.items()})}\")\nprint()\n\n# Collect rankings from all models in parallel\nrankings = {}\nwith ThreadPoolExecutor(max_workers=len(MODELS)) as executor:\n    futures = {\n        executor.submit(get_rankings, mid, QUERY, anonymized_text, model_to_label[mid]): mid\n        for mid in MODELS\n    }\n    for future in as_completed(futures):\n        model = futures[future]\n        result = future.result()\n        rankings[model] = result\n        status = \"OK\" if result[\"success\"] else \"FAILED\"\n        latency = f\"{result['latency_seconds']}s\" if result[\"success\"] else \"N\u002FA\"\n        print(f\"  [{status}] {model.split('\u002F')[-1]} ({latency})\")\n\n# Save rankings\noutput = {\n    \"label_mapping\": label_to_model,\n    \"model_to_label\": model_to_label,\n    \"rankings\": rankings\n}\nwith open(f\"{SESSION_DIR}\u002Fphase2_rankings.json\", \"w\") as f:\n    json.dump(output, f, indent=2)\n\nprint(f\"\\nPhase 2 complete. Rankings saved to: {SESSION_DIR}\u002Fphase2_rankings.json\")\nPYEOF\n```\n\n### Step 4: Run Phase 3 - Chairman Synthesis\n\nThe Chairman model receives all responses and rankings, then produces the final synthesis:\n\n```bash\nSESSION_DIR=\"\u002Ftmp\u002Fllm-council\u002FTIMESTAMP_HERE\"\nCHAIRMAN_MODEL=\"accounts\u002Ffireworks\u002Fmodels\u002Fglm-5\"\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nimport requests\nimport time\n\nFIREWORKS_API_KEY = os.environ.get(\"FIREWORKS_API_KEY\")\nAPI_URL = \"https:\u002F\u002Fapi.fireworks.ai\u002Finference\u002Fv1\u002Fchat\u002Fcompletions\"\nSESSION_DIR = os.environ.get(\"SESSION_DIR\")\nCHAIRMAN_MODEL = os.environ.get(\"CHAIRMAN_MODEL\")\n\n# Load all previous results\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\") as f:\n    config = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\") as f:\n    phase1 = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase2_rankings.json\") as f:\n    phase2 = json.load(f)\n\nQUERY = config[\"query\"]\nlabel_to_model = phase2[\"label_mapping\"]\nmodel_to_label = phase2[\"model_to_label\"]\n\n# Format responses with model names revealed\nresponses_text = []\nfor model_id, result in phase1.items():\n    label = model_to_label.get(model_id, \"?\")\n    model_name = model_id.split(\"\u002F\")[-1]\n    responses_text.append(f\"=== {label}: {model_name} ===\\n{result['content']}\")\n\n# Format rankings\nrankings_text = []\nfor model_id, result in phase2[\"rankings\"].items():\n    model_name = model_id.split(\"\u002F\")[-1]\n    rankings_text.append(f\"[{model_name}'s Rankings]\\n{result['content']}\")\n\nsynthesis_prompt = f\"\"\"You are the Chairman of an LLM Council. Your task is to synthesize the best possible answer from multiple AI responses.\n\nORIGINAL QUERY:\n{QUERY}\n\nINDIVIDUAL RESPONSES:\n{chr(10).join(responses_text)}\n\nMODEL RANKINGS:\n{chr(10).join(rankings_text)}\n\nAs Chairman, produce a FINAL SYNTHESIS that:\n1. Incorporates the strongest elements from the best-ranked responses\n2. Resolves any contradictions between responses\n3. Addresses aspects that multiple models agreed on\n4. Corrects any errors identified through cross-ranking\n5. Provides the most complete, accurate, and helpful answer\n\nBegin your synthesis:\"\"\"\n\nprint(f\"\\n{'='*60}\")\nprint(\"PHASE 3: Chairman Synthesis\")\nprint(f\"{'='*60}\")\nprint(f\"Chairman: {CHAIRMAN_MODEL.split('\u002F')[-1]}\")\nprint()\n\ntry:\n    start = time.time()\n    response = requests.post(\n        API_URL,\n        headers={\n            \"Authorization\": f\"Bearer {FIREWORKS_API_KEY}\",\n            \"Content-Type\": \"application\u002Fjson\"\n        },\n        json={\n            \"model\": CHAIRMAN_MODEL,\n            \"messages\": [\n                {\"role\": \"system\", \"content\": \"You are the Chairman of an LLM Council. Synthesize multiple AI perspectives into a definitive, comprehensive response.\"},\n                {\"role\": \"user\", \"content\": synthesis_prompt}\n            ],\n            \"max_tokens\": 4000,\n            \"temperature\": 1\n        },\n        timeout=180\n    )\n    response.raise_for_status()\n    elapsed = time.time() - start\n    synthesis = response.json()[\"choices\"][0][\"message\"][\"content\"]\n\n    with open(f\"{SESSION_DIR}\u002Fphase3_synthesis.txt\", \"w\") as f:\n        f.write(synthesis)\n\n    print(f\"Phase 3 complete ({elapsed:.2f}s). Synthesis saved to: {SESSION_DIR}\u002Fphase3_synthesis.txt\")\n\nexcept Exception as e:\n    print(f\"ERROR: {e}\")\n    synthesis = f\"[ERROR: {str(e)}]\"\n    with open(f\"{SESSION_DIR}\u002Fphase3_synthesis.txt\", \"w\") as f:\n        f.write(synthesis)\n\n# Update config with chairman\nconfig[\"chairman\"] = CHAIRMAN_MODEL\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\", \"w\") as f:\n    json.dump(config, f, indent=2)\nPYEOF\n```\n\n### Step 5: Display Full Results\n\nRead all saved files and display the complete council deliberation:\n\n```bash\nSESSION_DIR=\"\u002Ftmp\u002Fllm-council\u002FTIMESTAMP_HERE\"\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\n\nSESSION_DIR = os.environ.get(\"SESSION_DIR\")\n\n# Load all data\nwith open(f\"{SESSION_DIR}\u002Fconfig.json\") as f:\n    config = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase1_responses.json\") as f:\n    phase1 = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase2_rankings.json\") as f:\n    phase2 = json.load(f)\nwith open(f\"{SESSION_DIR}\u002Fphase3_synthesis.txt\") as f:\n    synthesis = f.read()\n\nmodel_to_label = phase2[\"model_to_label\"]\nlabel_to_model = phase2[\"label_mapping\"]\n\n# Build formatted output\noutput = []\noutput.append(\"=\" * 70)\noutput.append(\"                  LLM COUNCIL DELIBERATION\")\noutput.append(\"                  Powered by Fireworks AI\")\noutput.append(\"=\" * 70)\noutput.append(\"\")\noutput.append(f\"QUERY: {config['query']}\")\noutput.append(f\"COUNCIL: {', '.join([m.split('\u002F')[-1] for m in config['models']])}\")\noutput.append(f\"CHAIRMAN: {config.get('chairman', 'N\u002FA').split('\u002F')[-1]}\")\noutput.append(\"\")\n\n# Phase 1: Individual Responses\noutput.append(\"-\" * 70)\noutput.append(\"                 PHASE 1: INDIVIDUAL RESPONSES\")\noutput.append(\"-\" * 70)\noutput.append(\"\")\n\nfor model_id, result in phase1.items():\n    model_name = model_id.split(\"\u002F\")[-1]\n    label = model_to_label.get(model_id, \"?\")\n    latency = result.get(\"latency_seconds\", \"N\u002FA\")\n    tokens = result.get(\"tokens\", {})\n    output.append(f\"[{label}] {model_name} (latency: {latency}s, tokens: {tokens.get('total', 'N\u002FA')})\")\n    output.append(\"-\" * 40)\n    output.append(result[\"content\"])\n    output.append(\"\")\n\n# Phase 2: Cross-Model Rankings\noutput.append(\"-\" * 70)\noutput.append(\"                 PHASE 2: CROSS-MODEL RANKINGS\")\noutput.append(\"-\" * 70)\noutput.append(\"\")\noutput.append(f\"Label mapping: {json.dumps({v: k.split('\u002F')[-1] for k, v in model_to_label.items()}, indent=2)}\")\noutput.append(\"\")\n\nfor model_id, result in phase2[\"rankings\"].items():\n    model_name = model_id.split(\"\u002F\")[-1]\n    output.append(f\"[{model_name}'s Rankings]\")\n    output.append(result[\"content\"])\n    output.append(\"\")\n\n# Phase 3: Chairman Synthesis\noutput.append(\"-\" * 70)\noutput.append(\"                 PHASE 3: CHAIRMAN'S SYNTHESIS\")\noutput.append(\"-\" * 70)\noutput.append(\"\")\nchairman_name = config.get(\"chairman\", \"Chairman\").split(\"\u002F\")[-1]\noutput.append(f\"[{chairman_name} - Chairman]\")\noutput.append(\"\")\noutput.append(synthesis)\noutput.append(\"\")\noutput.append(\"=\" * 70)\noutput.append(f\"Session files: {SESSION_DIR}\u002F\")\n\n# Save formatted output\nfinal_output = \"\\n\".join(output)\nwith open(f\"{SESSION_DIR}\u002Ffinal_output.md\", \"w\") as f:\n    f.write(final_output)\n\nprint(final_output)\nprint(f\"\\nFull output saved to: {SESSION_DIR}\u002Ffinal_output.md\")\nPYEOF\n```\n\n## Important Notes\n\n1. **Session Directory**: Each run creates a unique session in `\u002Ftmp\u002Fllm-council\u002F{timestamp}\u002F`\n2. **Raw Data Preserved**: All API responses are saved as-is to JSON files for full transparency\n3. **Cost**: Fireworks pricing is per-token. More models and longer queries cost more. Check current pricing at https:\u002F\u002Ffireworks.ai\u002Fpricing\n4. **Latency Tracking**: Each API call tracks latency so you can see Fireworks' speed in action\n5. **Token Usage**: Phase 1 responses include token counts for cost awareness\n6. **Rate Limits**: If you hit rate limits, wait briefly and retry\n7. **Model Availability**: Check https:\u002F\u002Fapp.fireworks.ai\u002F for current model status\n\n## Setup\n\n1. Create a Fireworks AI account at https:\u002F\u002Ffireworks.ai\u002F and grab your API key from the dashboard\n2. Export it in your shell profile:\n   ```bash\n   read -rsp \"Fireworks API key: \" FIREWORKS_API_KEY\n   echo\n   export FIREWORKS_API_KEY\n   ```\n3. Restart your terminal or run `source ~\u002F.zshrc`\n4. Invoke this skill when you want multiple open-weight AI perspectives on a question\n\n\n## Limitations\n\n- Requires the upstream tool, account, API key, or local setup when the workflow names one.\n- Does not authorize destructive, production, paid, or external-message actions without explicit user approval.\n- Validate generated artifacts or recommendations against the user's real sources before treating them as final.\n",{"name":5,"risk":24,"tags":25,"tools":29,"author":33,"source":34,"license":15,"category":35,"date_added":36,"description":7,"source_repo":37,"source_type":34,"allowed-tools":38,"license_source":39},"safe",[26,27,28],"dair-academy","ai","workflow",[30,31,32],"claude-code","codex-cli","cursor","DAIR.AI","official","ai-agents","2026-06-19","dair-ai\u002Fdair-academy-plugins","Read, Write, Bash, AskUserQuestion","https:\u002F\u002Fgithub.com\u002Fdair-ai\u002Fdair-academy-plugins\u002Fblob\u002Fmain\u002FREADME.md#license","main","a4404a75dc81d6b7e58c5906b6aaffbcb5e84747","Claude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fllm-council",0,"https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills","https:\u002F\u002Fgithub.com\u002FMHassan0000","https:\u002F\u002Fhassanyousaf.vercel.app","Full Stack Developer building web apps, SaaS, AI systems, and automations. Passionate about clean code, UI\u002FUX, backend systems, and turning ideas into products.","2026-08-07 20:42:05",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add MHassan0000\u002FSkills --skill llm-council",{"tool":55,"command":56},"bunx","bunx skills add MHassan0000\u002FSkills --skill llm-council",{"tool":58,"command":59},"pnpm","pnpm dlx skills add MHassan0000\u002FSkills --skill llm-council","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fllm-council\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},".env.example","OTHER","其他",275,"https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fantigravity skills\u002Fagentic-awesome-skills\u002Fskills\u002Fllm-council\u002F.env.example",[70,77,84,91,100,108],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AGBX58S04DX8DKKME8N311","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AGBREE890608Z7YDMAKH27","stop-slop","Remove AI writing patterns from prose. Use when drafting, editing, or reviewing text to eliminate predictable AI tells and produce more human-like writing.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fstop-slop\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AGAS972A2AN7Q5EW8HEAXK","ogilvy-copywriting","Apply David Ogilvy's advertising principles when writing or reviewing copy, headlines, product descriptions, landing pages, ads, emails, or any persuasive text. Use when the goal is copy that sells, not copy that wins awards. Covers positioning, headlines, promises, brand voice, long-form copy, and visual logic. Source: How to Create Advertising That Sells (1972) + Ogilvy on Advertising.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Fogilvy\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":95,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7AGAF12803G5JPVMK79AYJB","frontend-design","Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\u002FCSS layouts, or when styling\u002Fbeautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fskills boraztunc github\u002Ffrontend-design\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":95,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7AG88WWVWCGJY9WA9CH7EY4","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":95,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7AG7ZTNV7XQCWDQ9674FBYB","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMHassan0000\u002FSkills\u002Fblob\u002Fmain\u002FClaude\u002Fobra superpower skills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[]]