[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72167":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},72167,"maestro","Doriandarko\u002Fmaestro","Doriandarko","A framework for Claude Opus to intelligently orchestrate subagents.",null,"Python",4344,653,69,35,0,1,9,3,60.85,false,"main",true,[],"2026-06-12 04:01:03","# Maestro - A Framework for Claude Opus, GPT and local LLMs to Orchestrate Subagents\n\n\nThis Python script demonstrates an AI-assisted task breakdown and execution workflow using the Anthropic API. It utilizes two AI models, Opus and Haiku, to break down an objective into sub-tasks, execute each sub-task, and refine the results into a cohesive final output.\n\n## New: \n# Updated the original Maestro to support Claude 3.5 Sonnet\n```bash\npython maestro.py\n```\n\n\n# Use Maestro with any APIs, Anthropic, Gemini, OpenAI, Cohere, etc.\nThanks to a rewrite of the codebase using LiteLLM, it's now much easier to select the model you want.\n\nSimply\n#### Set environment variables for API keys for the services you are using\nos.environ[\"OPENAI_API_KEY\"] = \"YOUR KEY\" \n\nos.environ[\"ANTHROPIC_API_KEY\"] = \"YOUR KEY\"\n\nos.environ[\"GEMINI_API_KEY\"] = \"YOUR KEY\"\n\n#### Define the models to be used for each stage\nORCHESTRATOR_MODEL = \"gemini\u002Fgemini-1.5-flash-latest\"\n\nSUB_AGENT_MODEL = \"gemini\u002Fgemini-1.5-flash-latest\"\n\nREFINER_MODEL = \"gemini\u002Fgemini-1.5-flash-latest\"\n\nOr gpt-3.5-turbo, etc.\n\nFirst install litellm\n```bash\npip install litellm\n```\n\nAfeter installing dependecies run\n\n```bash\npython maestro-anyapi.py\n```\n\n\n## GPT-4o\n\nThe GPT script has been updated from the ground up to support the code capabilities of GPT-4o\n\nAfeter installing dependecies run\n\n```bash\npython maestro-gpt4o.py\n```\n\n## Run locally with LMStudio or Ollama\n\n### Lmstudio\n\nFirst download the app here\nhttps:\u002F\u002Flmstudio.ai\u002F\n\nThen run the local server using your preferred method. I also recommend removing any system prompt for the app (leave your prompt field empty so it can take advantage of the script prompts).\n\nThen\n```bash\npython maestro-lmstudio.py\n```\n\n\n### Ollama\nMestro now runs locally thanks to the Ollama platform. Experience the power of Llama 3 locally! \n\nBefore running the script\n\nInstall Ollama client from here\nhttps:\u002F\u002Follama.com\u002Fdownload\n\nthen\n\n```bash\npip install ollama\n```\nAnd \n\n```bash\nollama.pull('llama3:70b')\n```\nThis will depend on the model you want to use it, you only need to do it once or if you want to update the model when a new version it's out.\nIn the script I am using both versions but you can customize the model you want to use\n\nollama.pull('llama3:70b')\nollama.pull('llama3:8b')\n\nThen\n\n```bash\npython maestro-ollama.py\n```\n\n## Highly requested features\n- GROQ SUPPORT\nExperience the power of maestro thanks to Groq super fast api responses.\n```bash\npip install groq\n```\nThen\n\n```bash\npython maestro-groq.py\n```\n\n\n- SEARCH 🔍\n\nNow, when it's creating a task for its subagent, Claude Opus will perform a search and get the best answer to help the subagent solve that task even better.\n\nMake sure you replace your Tavil API for search to work\n\nGet one here https:\u002F\u002Ftavily.com\u002F\n  \n- GPT4 SUPPORT\n\nAdd support for GPT-4 as an orchestrator in maestro-gpt.py\nSimply\n```bash\npython maestro-gpt.py\n```\n\nAfter you complete your installs.\n\n\n## Features\n\n- Breaks down an objective into manageable sub-tasks using the Opus model\n- Executes each sub-task using the Haiku model\n- Provides the Haiku model with memory of previous sub-tasks for context\n- Refines the sub-task results into a final output using the Opus model\n- Generates a detailed exchange log capturing the entire task breakdown and execution process\n- Saves the exchange log to a Markdown file for easy reference\n- Utilizes an improved prompt for the Opus model to better assess task completion\n- Creates code files and folders when working on code projects.\n\n## Prerequisites\n\nTo run this script, you need to have the following:\n\n- Python installed\n- Anthropic API key\n- Required Python packages: `anthropic` and `rich`\n\n## Installation\n\n1. Clone the repository or download the script file.\n2. Install the required Python packages by running the following command:\n\n```bash\npip install -r requirements.txt\n```\n\n3. Replace the placeholder API key in the script with your actual Anthropic API key:\n\n```python\nclient = Anthropic(api_key=\"YOUR_API_KEY_HERE\")\n```\n\nIf using search, replace your Tavil API\n```python\ntavily = TavilyClient(api_key=\"YOUR API KEY HERE\")\n```\n\n## Usage\n\n1. Open a terminal or command prompt and navigate to the directory containing the script.\n2. Run the script using the following command:\n\n```bash\npython maestro.py\n```\n\n3. Enter your objective when prompted:\n\n```bash\nPlease enter your objective: Your objective here\n```\n\nThe script will start the task breakdown and execution process. It will display the progress and results in the console using formatted panels.\n\nOnce the process is complete, the script will display the refined final output and save the full exchange log to a Markdown file with a filename based on the objective.\n\n## Code Structure\n\nThe script consists of the following main functions:\n\n- `opus_orchestrator(objective, previous_results=None)`: Calls the Opus model to break down the objective into sub-tasks or provide the final output. It uses an improved prompt to assess task completion and includes the phrase \"The task is complete:\" when the objective is fully achieved.\n- `haiku_sub_agent(prompt, previous_haiku_tasks=None)`: Calls the Haiku model to execute a sub-task prompt, providing it with the memory of previous sub-tasks.\n- `opus_refine(objective, sub_task_results)`: Calls the Opus model to review and refine the sub-task results into a cohesive final output.\n\nThe script follows an iterative process, repeatedly calling the opus_orchestrator function to break down the objective into sub-tasks until the final output is provided. Each sub-task is then executed by the haiku_sub_agent function, and the results are stored in the task_exchanges and haiku_tasks lists.\n\nThe loop terminates when the Opus model includes the phrase \"The task is complete:\" in its response, indicating that the objective has been fully achieved.\n\nFinally, the opus_refine function is called to review and refine the sub-task results into a final output. The entire exchange log, including the objective, task breakdown, and refined final output, is saved to a Markdown file.\n\n## Customization\n\nYou can customize the script according to your needs:\n\n- Adjust the max_tokens parameter in the client.messages.create() function calls to control the maximum number of tokens generated by the AI models.\n- Change the models to what you prefer, like replacing Haiku with Sonnet or Opus.\n- Modify the console output formatting by updating the rich library's Panel and Console configurations.\n- Customize the exchange log formatting and file extension by modifying the relevant code sections.\n\n## License\n\nThis script is released under the MIT License.\n\n## Acknowledgements\n\n- Anthropic for providing the AI models and API.\n- Rich for the beautiful console formatting.\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=Doriandarko\u002Fmaestro&type=Date)](https:\u002F\u002Fstar-history.com\u002F#Doriandarko\u002Fmaestro&Date)\n","Maestro 是一个用于智能编排子代理的框架，支持Claude Opus、GPT及本地大语言模型。其核心功能包括利用AI辅助任务分解和执行工作流，通过Anthropic API等服务调用不同的AI模型来实现目标拆解、子任务执行以及结果整合。技术特点上，Maestro采用Python编写，并通过LiteLLM库重写以简化不同模型的选择过程，支持多种API接口如Anthropic、Gemini、OpenAI等。此外，该项目还提供了运行于本地环境（如LMStudio或Ollama）的能力，增强了灵活性与适用性。Maestro适用于需要高效组织多个AI助手协同完成复杂任务的场景，比如项目管理、内容创作等领域。",2,"2026-06-11 03:40:40","high_star"]