token_efficient_reasoning
Optimize token usage by delegating complex reasoning tasks to local AI, conserving cloud resources while maintaining task accuracy and context awareness.
Instructions
Delegate heavy reasoning to local AI to conserve cloud tokens
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Additional context for reasoning | |
| model | No | Local model for reasoning | architecture-reasoning:latest |
| reasoning_task | Yes | Complex reasoning task to delegate |
Implementation Reference
- local-ai-server.js:307-338 (handler)The main handler function for 'token_efficient_reasoning'. Constructs a detailed structured prompt for comprehensive reasoning analysis and delegates execution to the shared queryLocalAI method using the specified local model.async tokenEfficientReasoning(reasoningTask, context = '', model = 'architecture-reasoning:latest') { const efficientPrompt = `REASONING DELEGATION TASK: Task: ${reasoningTask} ${context ? `Context: ${context}` : ''} Please provide comprehensive reasoning analysis including: 1. PROBLEM DECOMPOSITION - Break down the task into components - Identify key variables and relationships 2. REASONING CHAIN - Step-by-step logical progression - Evidence and justification for each step 3. ALTERNATIVE APPROACHES - Consider different methodologies - Compare pros/cons of approaches 4. SYNTHESIS - Integrate findings into coherent solution - Address potential counterarguments 5. CONCLUSION - Clear final reasoning result - Confidence level and limitations Optimize for thorough reasoning while being concise in presentation.`; return await this.queryLocalAI(efficientPrompt, model, 0.6); }
- local-ai-server.js:117-135 (schema)Input schema definition for the 'token_efficient_reasoning' tool, specifying required 'reasoning_task' parameter and optional 'context' and 'model'.inputSchema: { type: 'object', properties: { reasoning_task: { type: 'string', description: 'Complex reasoning task to delegate' }, context: { type: 'string', description: 'Additional context for reasoning' }, model: { type: 'string', description: 'Local model for reasoning', default: 'architecture-reasoning:latest' } }, required: ['reasoning_task'] }
- local-ai-server.js:114-136 (registration)Tool registration in the ListToolsRequestHandler response, including name, description, and full input schema.{ name: 'token_efficient_reasoning', description: 'Delegate heavy reasoning to local AI to conserve cloud tokens', inputSchema: { type: 'object', properties: { reasoning_task: { type: 'string', description: 'Complex reasoning task to delegate' }, context: { type: 'string', description: 'Additional context for reasoning' }, model: { type: 'string', description: 'Local model for reasoning', default: 'architecture-reasoning:latest' } }, required: ['reasoning_task'] } }
- local-ai-server.js:158-159 (registration)Dispatch case in the CallToolRequestHandler switch statement that routes calls to the tokenEfficientReasoning handler method.case 'token_efficient_reasoning': return await this.tokenEfficientReasoning(args.reasoning_task, args.context, args.model);