-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
320 lines (283 loc) · 15.9 KB
/
Copy pathindex.html
File metadata and controls
320 lines (283 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Claw Dev - Multi-Provider Coding Assistant Launcher</title>
<link rel="stylesheet" href="style.css">
<!-- Google Fonts for a nicer look -->
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
</head>
<body>
<header class="hero">
<div class="container">
<h1>Claw Dev</h1>
<p>A multi-provider coding assistant launcher.</p>
</div>
</header>
<main class="container">
<section id="features" class="card">
<h2>✨ Key Features</h2>
<ul>
<li><strong>Flexible AI Provider Selection</strong>: Choose between Anthropic, Google Gemini, Groq, or Ollama directly at startup.</li>
<li><strong>Anthropic-Compatible Proxy</strong>: Seamlessly integrate Gemini, Groq, and Ollama through a local proxy, maintaining a consistent terminal experience.</li>
<li><strong>Consistent User Experience</strong>: Designed to feel like one unified tool, with unified launcher, prompts, environment variables, and documentation.</li>
<li><strong>Local Inference Support</strong>: Best-in-class support for Ollama, enabling local inference without relying on cloud API providers.</li>
</ul>
</section>
<section id="tech-stack" class="card">
<h2>🛠️ Tech Stack & Supported Providers</h2>
<p>Claw Dev integrates with various AI models and services, utilizing a Node.js-based client with an internal compatibility proxy.</p>
<div class="table-container">
<table>
<thead>
<tr>
<th>Component / Provider</th>
<th>Technology / Integration</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Core Client</strong></td>
<td><img src="https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="Node.js"> <img src="https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript"></td>
</tr>
<tr>
<td><strong>Anthropic</strong></td>
<td>Direct integration via account login or `ANTHROPIC_API_KEY`</td>
</tr>
<tr>
<td><strong>Google Gemini</strong></td>
<td>Integrated via local Anthropic-compatible proxy, requires `GEMINI_API_KEY`</td>
</tr>
<tr>
<td><strong>Groq</strong></td>
<td>Integrated via local Anthropic-compatible proxy, requires `GROQ_API_KEY`</td>
</tr>
<tr>
<td><strong>Ollama</strong></td>
<td>Integrated via local Anthropic-compatible proxy, supports local or remote Ollama servers (e.g., `qwen3`)</td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="installation" class="card">
<h2>🚀 Installation & Usage</h2>
<h3>1. Requirements</h3>
<p>Ensure you have the following installed:</p>
<ul>
<li><strong>Node.js</strong>: Version 22 or newer.</li>
<li><strong>npm</strong>: Node Package Manager (comes with Node.js).</li>
<li><strong>Git for Windows</strong>: Recommended for Windows users for optimal terminal workflow.</li>
</ul>
<p><strong>Provider-specific requirements:</strong></p>
<ul>
<li><strong>Anthropic</strong>: An Anthropic account for in-app login, or `ANTHROPIC_API_KEY`.</li>
<li><strong>Gemini</strong>: `GEMINI_API_KEY`.</li>
<li><strong>Groq</strong>: `GROQ_API_KEY`.</li>
<li><strong>Ollama</strong>: A running Ollama installation with at least one pulled model (e.g., `qwen3`).</li>
</ul>
<h3>2. Installation Steps</h3>
<p><strong>Clone the repository</strong>:</p>
<pre><code>git clone https://github.com/akariwill/Claw-Dev.git</code></pre>
<p>From the repository root:</p>
<pre><code>cd E:\Claw-Dev # Adjust path if different
npm install
copy .env.example .env</code></pre>
<p><em>Note: Editing <code>.env</code> is optional. Claw Dev can prompt for missing values interactively when it starts.</em></p>
<h3>3. Quick Start</h3>
<p>Start Claw Dev from the repository root:</p>
<pre><code>npm run claw-dev</code></pre>
<p>Alternatively, launch directly from the bundled client directory:</p>
<pre><code>cd E:\Claw-Dev\claude-code # Adjust path if different
.\claw-dev.cmd</code></pre>
<p>When Claw Dev starts, it presents a provider selector:</p>
<ol>
<li>Anthropic</li>
<li>Gemini</li>
<li>Groq</li>
<li>Ollama</li>
</ol>
<p>If a required API key is missing, Claw Dev will prompt for it.</p>
</section>
<section id="architecture" class="card">
<h2>🤖 Architecture Overview</h2>
<p>Claw Dev operates in two primary modes to maintain a consistent terminal experience while supporting diverse model backends:</p>
<ol>
<li>
<strong>Anthropic Mode</strong>:
<ul>
<li>The bundled client communicates directly with Anthropic APIs.</li>
</ul>
</li>
<li>
<strong>Compatibility Mode</strong>:
<ul>
<li>The bundled client interacts with a local proxy (`src/anthropicCompatProxy.ts`).</li>
<li>This local proxy translates Anthropic-style `/v1/messages` requests into native API calls for Gemini, Groq, or Ollama.</li>
</ul>
</li>
</ol>
</section>
<section id="ollama-usage" class="card">
<h2>💡 How To Use Ollama With Claw Dev</h2>
<p>Ollama offers local inference, ideal for those who prefer not to depend on cloud API providers.</p>
<h3>1. Install Ollama</h3>
<p>Install Ollama from its official download page: <a href="https://ollama.com/download">Ollama Downloads</a></p>
<p>Ensure the Ollama application or service is running post-installation.</p>
<h3>2. Pull a Local Model</h3>
<p>For a quick start, pull a lightweight model:</p>
<pre><code>ollama pull qwen3</code></pre>
<p>Verify model availability:</p>
<pre><code>ollama list</code></pre>
<h3>3. Start the Ollama Server</h3>
<p>If not already running in the background:</p>
<pre><code>ollama serve</code></pre>
<p>The default local API base URL is <code>http://127.0.0.1:11434</code>.</p>
<h3>4. Start Claw Dev and Select Ollama</h3>
<pre><code>cd E:\Claw-Dev # Adjust path if different
npm run claw-dev</code></pre>
<p>Then choose option <code>4. Ollama</code>.</p>
<p>Claw Dev will route requests through its local compatibility proxy to your Ollama server.</p>
<h3>5. Optional Environment Configuration for Ollama</h3>
<p>Preconfigure Ollama mode in your <code>.env</code> file:</p>
<pre><code>OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=qwen3
OLLAMA_API_KEY= # Not required for local Ollama on localhost
OLLAMA_KEEP_ALIVE=30m # Keeps model loaded, reduces warm-up time
OLLAMA_NUM_CTX=2048 # Controls prompt context size
OLLAMA_NUM_PREDICT=128 # Limits output length, can reduce latency</code></pre>
<h3>6. Verify Ollama Usage</h3>
<p>To check which models are loaded and their processor usage:</p>
<pre><code>ollama ps</code></pre>
<p>To confirm the Claw Dev proxy health:</p>
<pre><code>npm run proxy:compat</code></pre>
<p>Then open <a href="http://127.0.0.1:8789/health"><code>http://127.0.0.1:8789/health</code></a> in your browser. A JSON response with the active provider and model should appear when Ollama mode is configured.</p>
<h3>7. Ollama Performance Tuning</h3>
<p>Consider these points for optimal performance:</p>
<ul>
<li>Larger context windows and longer outputs generally lead to slower responses.</li>
<li>First-token latency is usually highest on the initial request after a model loads.</li>
<li>CPU-only inference is significantly slower than GPU-backed inference.</li>
</ul>
<p><strong>Recommended starting values for responsiveness:</strong></p>
<pre><code>OLLAMA_KEEP_ALIVE=30m
OLLAMA_NUM_CTX=2048
OLLAMA_NUM_PREDICT=128</code></pre>
<p>Adjust <code>OLLAMA_NUM_CTX</code> for quality vs. speed. Reduce <code>OLLAMA_NUM_PREDICT</code> for shorter answers and lower latency. If <code>ollama ps</code> shows <code>100% CPU</code>, slow generation is expected; consider smaller models, optimizing <code>OLLAMA_NUM_CTX</code>, <code>OLLAMA_NUM_PREDICT</code>, and leveraging <code>OLLAMA_KEEP_ALIVE</code>.</p>
</section>
<section id="env-vars" class="card">
<h2>⚙️ Recommended Environment Variables</h2>
<p>Configure your <code>.env</code> file with the appropriate API keys and model names:</p>
<h3>Anthropic</h3>
<pre><code>ANTHROPIC_API_KEY=your_anthropic_api_key_here
ANTHROPIC_MODEL=claude-sonnet-4-20250514</code></pre>
<h3>Gemini</h3>
<pre><code>GEMINI_API_KEY=your_gemini_api_key_here
GEMINI_MODEL=gemini-2.5-flash</code></pre>
<h3>Groq</h3>
<pre><code>GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=openai/gpt-oss-20b</code></pre>
<h3>Ollama</h3>
<pre><code>OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=qwen3
OLLAMA_API_KEY=
OLLAMA_KEEP_ALIVE=30m # Keeps model loaded, reduces warm-up time
OLLAMA_NUM_CTX=2048 # Controls prompt context size
OLLAMA_NUM_PREDICT=128 # Limits output length, can reduce latency</code></pre>
</section>
<section id="cli-commands" class="card">
<h2>CLI Useful Commands</h2>
<h3>Check Version</h3>
<pre><code>cd E:\Claw-Dev\claude-code # Adjust path if different
.\claw-dev.cmd --version</code></pre>
<h3>Force Specific Provider</h3>
<p>Skip the provider menu:</p>
<pre><code>.\claw-dev.cmd --provider anthropic
.\claw-dev.cmd --provider gemini
.\claw-dev.cmd --provider groq
.\claw-dev.cmd --provider ollama</code></pre>
<p><em>Legacy aliases (<code>--provider claude</code>, <code>--provider grok</code>) are also supported.</em></p>
<h3>One-Shot Prompt</h3>
<pre><code>echo "Summarize this repository" | .\claw-dev.cmd --bare -p</code></pre>
</section>
<section id="project-structure" class="card">
<h2>📂 Project Structure</h2>
<pre><code>claw-dev/
├── claude-code/ # Bundled terminal client and Windows launchers
│ └── ...
├── src/anthropicCompatProxy.ts # Local Anthropic-compatible proxy for Gemini, Groq, Ollama
├── .env.example # Optional environment template for local setup
├── package.json # Root scripts for launching, building, and validating
└── ... # Other project files
</code></pre>
</section>
<section id="git-privacy" class="card">
<h2>🔒 Git Privacy Before Publishing</h2>
<p>Before public commits, verify your local Git identity:</p>
<h3>Recommended settings:</h3>
<pre><code>git config user.name "YOURUSERNAME"
git config user.email "YOUREMAIL"</code></pre>
<p>Verify active values:</p>
<pre><code>git config user.name
git config user.email</code></pre>
<p><strong>Important notes:</strong></p>
<ul>
<li><code>.env</code>, <code>node_modules</code>, <code>dist</code>, and <code>*.log</code> files are ignored by <code>.gitignore</code>.</li>
<li>Always review <code>git status</code> before staging and <code>git diff --cached</code> before pushing.</li>
</ul>
</section>
<section id="troubleshooting" class="card">
<h2>⁉️ Troubleshooting</h2>
<h3>Ollama does not answer</h3>
<ul>
<li>Ensure Ollama is installed and its service/app is running.</li>
<li>Confirm <code>ollama serve</code> is active if required.</li>
<li>Verify the selected model was pulled successfully.</li>
<li>Check that <code>OLLAMA_BASE_URL</code> in <code>.env</code> points to the correct server.</li>
</ul>
<h3>Ollama answers slowly</h3>
<p>Common causes include CPU-only inference, excessively large models for your hardware, context windows that are too large, or long requested outputs.</p>
<p>Use <code>ollama ps</code> to inspect model loading. If <code>PROCESSOR</code> shows <code>100% CPU</code>, slow generation is expected. Consider smaller models, optimizing <code>OLLAMA_NUM_CTX</code>, <code>OLLAMA_NUM_PREDICT</code>, and leveraging <code>OLLAMA_KEEP_ALIVE</code>.</p>
<h3>Cloud providers work, but Ollama does not</h3>
<p>This indicates Claw Dev is likely functioning, but your local Ollama server might be unreachable or lacks the requested model.</p>
</section>
<section id="sharing" class="card">
<h2>👋 Sharing With Another User</h2>
<p>For the shortest setup path when sharing this repository:</p>
<ol>
<li>Install Node.js 22 or newer.</li>
<li>Run <code>npm install</code>.</li>
<li>Start <code>npm run claw-dev</code>.</li>
<li>Choose a provider.</li>
<li>Supply credentials or run Ollama locally.</li>
</ol>
<p>A separate global installation of the bundled client is not required.</p>
</section>
<section id="verification" class="card">
<h2>✅ Verification</h2>
<p>Run these commands for useful checks:</p>
<pre><code>npm run check
npm run build
npm run claw-dev -- --version</code></pre>
</section>
<section id="references" class="card">
<h2>🔗 References</h2>
<p>Official documentation and resources used for this setup:</p>
<ul>
<li><a href="https://docs.ollama.com/">Ollama Documentation</a></li>
<li><a href="https://docs.ollama.com/api/introduction">Ollama API Introduction</a></li>
<li><a href="https://docs.ollama.com/api/authentication">Ollama API Authentication</a></li>
<li><a href="https://docs.ollama.com/faq">Ollama FAQ</a></li>
<li><a href="https://code.claude.com/docs/en/quickstart">Anthropic Claude Code Quickstart</a></li>
<li><a href="https://console.groq.com/docs">Groq Docs</a></li>
</ul>
</section>
</main>
<footer>
<div class="container">
<p>© 2026 akariwill | Claw-Dev. All rights reserved.</p>
</div>
</footer>
</body>
</html>