florianguyonnet commited on
Commit
f92c4f9
Β·
verified Β·
1 Parent(s): 656e8bd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +131 -4
README.md CHANGED
@@ -1,7 +1,134 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
2
  datasets:
3
- - kirha/planner-dataset
4
- base_model:
5
- - Qwen/Qwen3-8B
6
  ---
7
- # Kirha Planner
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ base_model: Qwen/Qwen3-8B
6
+ tags:
7
+ - tool-calling
8
+ - planning
9
+ - agent
10
+ - qwen3
11
+ - lora
12
  datasets:
13
+ - kirha/planner-dataset
 
 
14
  ---
15
+
16
+ # Kirha Planner
17
+
18
+ A fine-tuned Qwen3-8B model that generates complete tool execution plans from natural language queries in a single pass.
19
+
20
+ ## Why Tool Planning?
21
+
22
+ Traditional agentic systems let the LLM call tools iteratively until it finds the right data. This leads to unpredictable costs, high latency, and bloated context windows.
23
+
24
+ Tool Planning takes a different approach: analyze the request, build a complete execution graph, and only then execute. One LLM call produces the entire DAG β€” no back-and-forth.
25
+
26
+ This unlocks:
27
+ - **Cost predictability**: the plan is known before execution, costs can be estimated upfront
28
+ - **Parallel execution**: independent steps run concurrently, dependent steps chain automatically
29
+ - **Audit trail**: every plan includes reasoning traces and a complete execution log
30
+
31
+ ### Composition with Output Schemas
32
+
33
+ Tool Planning relies on `outputSchema`, a capability now part of the official MCP specification. With output schemas, the planner knows what each tool returns before execution and can chain tools by matching output fields to input parameters. No exploratory calls needed.
34
+
35
+ ## Output format
36
+
37
+ Given a set of tools and a user query, the model outputs:
38
+
39
+ ```
40
+ <think>
41
+ I need to find the largest USDC holder on Base, then get their PnL.
42
+ First I need the chain ID for Base and the USDC contract address...
43
+ </think>
44
+ <plan>
45
+ [
46
+ {
47
+ "thought": "Get the chain ID for Base",
48
+ "toolName": "getChainId",
49
+ "arguments": { "blockchain": "Base" }
50
+ },
51
+ {
52
+ "thought": "Search for the USDC coin",
53
+ "toolName": "searchCoin",
54
+ "arguments": { "query": "USDC", "limit": 1 }
55
+ },
56
+ {
57
+ "thought": "Get the USDC contract address on Base",
58
+ "toolName": "getCoinPlatformInfo",
59
+ "arguments": {
60
+ "coinId": "{1.coins.0.id}",
61
+ "platform": "base"
62
+ }
63
+ },
64
+ {
65
+ "thought": "Get the top holder of USDC on Base",
66
+ "toolName": "getTokenHolders",
67
+ "arguments": {
68
+ "chainId": "{0.chainId}",
69
+ "tokenAddress": "{2.contractAddress}",
70
+ "limit": 1
71
+ }
72
+ },
73
+ {
74
+ "thought": "Get the PnL for this wallet",
75
+ "toolName": "getWalletPnL",
76
+ "arguments": {
77
+ "address": "{3.holders.0.address}"
78
+ }
79
+ }
80
+ ]
81
+ </plan>
82
+ ```
83
+
84
+ ### Dependency references
85
+
86
+ Steps reference previous outputs using template strings:
87
+ - `{0.chainId}` β€” field `chainId` from step 0
88
+ - `{1.coins.0.id}` β€” nested path from step 1
89
+ - `{3.holders.0.address}` β€” array access from step 3
90
+
91
+ ### Execution graph
92
+
93
+ ```
94
+ Step 0: getChainId Step 1: searchCoin
95
+ β”‚ β”‚
96
+ β”‚ ↓
97
+ β”‚ Step 2: getCoinPlatformInfo
98
+ β”‚ β”‚
99
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
100
+ ↓
101
+ Step 3: getTokenHolders
102
+ β”‚
103
+ ↓
104
+ Step 4: getWalletPnL
105
+ ```
106
+
107
+ Steps 0 and 1 run in parallel. Step 3 waits for both 0 and 2. The executor resolves references at runtime.
108
+
109
+ ## Usage
110
+
111
+ Use the [`@kirha/planner`](https://www.npmjs.com/package/@kirha/planner) TypeScript SDK to interact with this model. It handles parsing, validation, dependency resolution, and parallel execution of plans.
112
+
113
+ ```bash
114
+ npm install @kirha/planner
115
+ ```
116
+
117
+ Tools can come from any source, including MCP servers that have `outputSchema` defined.
118
+
119
+ See the [SDK documentation](https://github.com/kirha-ai/planner-typescript-sdk) for full usage examples.
120
+
121
+ ## Training
122
+
123
+ - **Base model**: Qwen/Qwen3-8B
124
+ - **Method**: QLoRA (4-bit NF4, LoRA r=64, alpha=128)
125
+ - **Format**: Alpaca (instruction/input/output)
126
+ - **Dataset**: [kirha/planner-dataset](https://huggingface.co/datasets/kirha/planner-dataset)
127
+
128
+ The model learns planning methodology rather than memorizing specific APIs, enabling zero-shot generalization to any tool catalog at inference time. Noise tools are injected during training to teach discrimination between relevant and irrelevant options.
129
+
130
+ ## Links
131
+
132
+ - [Dataset](https://huggingface.co/datasets/kirha/planner-dataset)
133
+ - [TypeScript SDK](https://www.npmjs.com/package/@kirha/planner)
134
+ - [Planner SDK source](https://github.com/kirha-ai/planner-typescript-sdk)