[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DMQDEK1ADZ767BTJSE2657":3,"skill-same:01M7DMQDEK1ADZ767BTJSE2657":67},{"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":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M7DMQDEK1ADZ767BTJSE2657","llm-council",null,"Run Fireworks-hosted open-weight model councils that compare responses and synthesize a final answer.","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\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","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Fllm-council",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill llm-council",{"tool":53,"command":54},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill llm-council",{"tool":56,"command":57},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill llm-council","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fllm-council\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},".env.example","OTHER","其他",275,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fllm-council\u002F.env.example",[68,75,82,89,96,103],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]