Add nano-gpt.com as a provider
This commit is contained in:
21 files changed
+535
-2
No files matched your search
+2
-1
@@ -297,7 +297,7 @@ Options:
|
||||
- `--non-interactive`
|
||||
- `--mode <local|remote>`
|
||||
- `--flow <quickstart|advanced|manual>` (manual is an alias for advanced)
|
||||
- `--auth-choice <setup-token|claude-cli|token|openai-codex|openai-api-key|openrouter-api-key|ai-gateway-api-key|moonshot-api-key|kimi-code-api-key|codex-cli|gemini-api-key|zai-api-key|apiKey|minimax-api|opencode-zen|skip>`
|
||||
- `--auth-choice <setup-token|claude-cli|token|openai-codex|openai-api-key|openrouter-api-key|ai-gateway-api-key|moonshot-api-key|kimi-code-api-key|nanogpt-api-key|codex-cli|gemini-api-key|zai-api-key|apiKey|minimax-api|opencode-zen|skip>`
|
||||
- `--token-provider <id>` (non-interactive; used with `--auth-choice token`)
|
||||
- `--token <token>` (non-interactive; used with `--auth-choice token`)
|
||||
- `--token-profile-id <id>` (non-interactive; default: `<provider>:manual`)
|
||||
@@ -308,6 +308,7 @@ Options:
|
||||
- `--ai-gateway-api-key <key>`
|
||||
- `--moonshot-api-key <key>`
|
||||
- `--kimi-code-api-key <key>`
|
||||
- `--nanogpt-api-key <key>`
|
||||
- `--gemini-api-key <key>`
|
||||
- `--zai-api-key <key>`
|
||||
- `--minimax-api-key <key>`
|
||||
|
||||
@@ -157,6 +157,34 @@ Moonshot uses OpenAI-compatible endpoints, so configure it as a custom provider:
|
||||
}
|
||||
```
|
||||
|
||||
### NanoGPT
|
||||
|
||||
NanoGPT exposes OpenAI-compatible endpoints:
|
||||
|
||||
- Provider: `nanogpt`
|
||||
- Auth: `NANOGPT_API_KEY`
|
||||
- Example model: `nanogpt/zai-org/glm-4.7`
|
||||
- CLI: `clawdbot onboard --auth-choice nanogpt-api-key`
|
||||
|
||||
```json5
|
||||
{
|
||||
agents: {
|
||||
defaults: { model: { primary: "nanogpt/zai-org/glm-4.7" } }
|
||||
},
|
||||
models: {
|
||||
mode: "merge",
|
||||
providers: {
|
||||
nanogpt: {
|
||||
baseUrl: "https://nano-gpt.com/api/v1",
|
||||
apiKey: "${NANOGPT_API_KEY}",
|
||||
api: "openai-completions",
|
||||
models: [{ id: "zai-org/glm-4.7", name: "GLM 4.7" }]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Kimi Code
|
||||
|
||||
Kimi Code uses a dedicated endpoint and key (separate from Moonshot):
|
||||
|
||||
@@ -36,6 +36,7 @@ See [Venice AI](/providers/venice).
|
||||
- [OpenAI (API + Codex)](/providers/openai)
|
||||
- [Anthropic (API + Claude Code CLI)](/providers/anthropic)
|
||||
- [Qwen (OAuth)](/providers/qwen)
|
||||
- [NanoGPT](/providers/nanogpt)
|
||||
- [OpenRouter](/providers/openrouter)
|
||||
- [Vercel AI Gateway](/providers/vercel-ai-gateway)
|
||||
- [Moonshot AI (Kimi + Kimi Code)](/providers/moonshot)
|
||||
|
||||
@@ -33,6 +33,7 @@ See [Venice AI](/providers/venice).
|
||||
|
||||
- [OpenAI (API + Codex)](/providers/openai)
|
||||
- [Anthropic (API + Claude Code CLI)](/providers/anthropic)
|
||||
- [NanoGPT](/providers/nanogpt)
|
||||
- [OpenRouter](/providers/openrouter)
|
||||
- [Vercel AI Gateway](/providers/vercel-ai-gateway)
|
||||
- [Moonshot AI (Kimi + Kimi Code)](/providers/moonshot)
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
---
|
||||
summary: "Use NanoGPT's OpenAI-compatible API in Clawdbot"
|
||||
read_when:
|
||||
- You want to use NanoGPT as a model provider
|
||||
- You need a NanoGPT API key or base URL setup
|
||||
---
|
||||
# NanoGPT
|
||||
|
||||
NanoGPT exposes OpenAI-compatible endpoints. Clawdbot registers it as the
|
||||
`nanogpt` provider.
|
||||
|
||||
## Quick setup
|
||||
|
||||
1) Set `NANOGPT_API_KEY` (or run the wizard below).
|
||||
2) Run onboarding:
|
||||
|
||||
```bash
|
||||
clawdbot onboard --auth-choice nanogpt-api-key
|
||||
```
|
||||
|
||||
The default model is set to:
|
||||
|
||||
```
|
||||
nanogpt/zai-org/glm-4.7
|
||||
```
|
||||
|
||||
## Config example
|
||||
|
||||
```json5
|
||||
{
|
||||
env: { NANOGPT_API_KEY: "sk-..." },
|
||||
agents: {
|
||||
defaults: {
|
||||
model: { primary: "nanogpt/zai-org/glm-4.7" },
|
||||
models: { "nanogpt/zai-org/glm-4.7": { alias: "GLM 4.7" } }
|
||||
}
|
||||
},
|
||||
models: {
|
||||
mode: "merge",
|
||||
providers: {
|
||||
nanogpt: {
|
||||
baseUrl: "https://nano-gpt.com/api/v1",
|
||||
apiKey: "${NANOGPT_API_KEY}",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "zai-org/glm-4.7",
|
||||
name: "GLM 4.7",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 200000,
|
||||
maxTokens: 65535
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Model refs use `nanogpt/<modelId>`.
|
||||
- If you enable a model allowlist (`agents.defaults.models`), add every model you plan to use.
|
||||
- For the full provider catalog and configuration rules, see [Model providers](/concepts/model-providers).
|
||||
@@ -248,6 +248,17 @@ clawdbot onboard --non-interactive \
|
||||
--gateway-bind loopback
|
||||
```
|
||||
|
||||
NanoGPT example:
|
||||
|
||||
```bash
|
||||
clawdbot onboard --non-interactive \
|
||||
--mode local \
|
||||
--auth-choice nanogpt-api-key \
|
||||
--nanogpt-api-key "$NANOGPT_API_KEY" \
|
||||
--gateway-port 18789 \
|
||||
--gateway-bind loopback
|
||||
```
|
||||
|
||||
OpenCode Zen example:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in new issue
Block a user