feat: add NanoGPT as AI provider
adds https://nano-gpt.com as a provider
Walkthrough
Adds NanoGPT as a supported AI provider across the project. Changes include: new constants and defaults for NanoGPT (model, endpoint, API token secret), a CLI flag and testNanoGPT command wired into the testai tool, inclusion of nanogpt in AIModeConfigType enums and the JSON schema, addition of AIProvider_NanoGPT constant, and documentation updates describing NanoGPT provider configuration and examples.
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title accurately summarizes the primary change: adding NanoGPT as a new AI provider, which is reflected throughout the changeset. |
| Description check | ✅ Passed | The description directly relates to the changeset by stating that NanoGPT is being added as a provider with a reference to the service. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
📜 Recent review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 32871c37cfd1c59518647290debcabe9424d0c1a and 83fa10c3754cd2c890840e2c304b71f60679e2df.
📒 Files selected for processing (1)
-
cmd/testai/main-testai.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T03:21:02.229Z
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2433
File: pkg/aiusechat/tools_readfile.go:197-197
Timestamp: 2025-10-15T03:21:02.229Z
Learning: In Wave Terminal's AI tool definitions (pkg/aiusechat/tools_*.go), the Description field should not mention approval requirements even when ToolApproval returns ApprovalNeedsApproval. This prevents the LLM from asking users for approval before calling the tool, avoiding redundant double-approval prompts since the runtime will enforce approval anyway.
Applied to files:
-
cmd/testai/main-testai.go
🔇 Additional comments (3)
cmd/testai/main-testai.go (3)
261-308: LGTM! Critical issues from previous review have been fixed.The implementation correctly addresses the previous concerns:
- ✅ Uses
NANOGPT_KEYenvironment variable (matching production configuration)- ✅ Removed
ThinkingLevelparameter (avoiding unsupported API features)The function structure is consistent with other OpenAI-compatible providers (
testOpenRouter,testOpenAIComp) and properly configures the NanoGPT endpoint.
434-434: LGTM! Documentation properly integrated.The usage examples and environment variable documentation are consistent with other providers and correctly reference
NANOGPT_KEY.Also applies to: 443-444, 454-454, 461-461
466-466: LGTM! Flag and routing logic properly implemented.The flag definitions and conditional routing follow the established pattern for other providers. The integration is complete and consistent.
Also applies to: 471-471, 474-474, 515-516, 541-542
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
@coderabbitai generate docstrings
✅ Actions performed
Initiated docstring generation; will generate only if new commits exist.
[!NOTE] Docstrings generation - SUCCESS Generated docstrings for this pull request at https://github.com/wavetermdev/waveterm/pull/2747
@0xGingi thanks for submitting, will take a look. at first glance looks good