Skip to content

Conversation

@0xGingi
Copy link

@0xGingi 0xGingi commented Jan 3, 2026

adds https://nano-gpt.com as a provider

@CLAassistant
Copy link

CLAassistant commented Jan 3, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

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 32871c3 and 83fa10c.

📒 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_KEY environment variable (matching production configuration)
  • ✅ Removed ThinkingLevel parameter (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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a07e078 and 32871c3.

📒 Files selected for processing (6)
  • cmd/testai/main-testai.go
  • docs/docs/waveai-modes.mdx
  • pkg/aiusechat/uctypes/uctypes.go
  • pkg/aiusechat/usechat-mode.go
  • pkg/wconfig/settingsconfig.go
  • schema/waveai.json
🧰 Additional context used
🧬 Code graph analysis (2)
pkg/aiusechat/usechat-mode.go (1)
pkg/aiusechat/uctypes/uctypes.go (2)
  • AIProvider_NanoGPT (30-30)
  • APIType_OpenAIChat (22-22)
cmd/testai/main-testai.go (3)
pkg/aiusechat/uctypes/uctypes.go (8)
  • ToolDefinition (100-116)
  • AIOptsType (271-285)
  • APIType_OpenAIChat (22-22)
  • ThinkingLevelMedium (156-156)
  • AIMessage (360-363)
  • AIMessagePart (365-381)
  • AIMessagePartTypeText (355-355)
  • WaveChatOpts (516-536)
frontend/app/aipanel/aimessage.tsx (1)
  • AIMessage (210-267)
pkg/aiusechat/usechat.go (1)
  • WaveAIPostMessageWrap (543-585)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: merge-gatekeeper
🔇 Additional comments (10)
pkg/aiusechat/usechat-mode.go (2)

104-114: LGTM! Implementation follows established patterns.

The NanoGPT provider defaults are implemented consistently with the OpenRouter provider (lines 93-103). The approach of not setting default capabilities is appropriate for a proxy service where model capabilities vary.


24-24: NanoGPT endpoint URL is correct. The endpoint https://nano-gpt.com/api/v1/chat/completions matches the official NanoGPT API documentation for chat completions and is properly integrated throughout the codebase.

pkg/aiusechat/uctypes/uctypes.go (1)

30-30: LGTM! Constant follows naming conventions.

The constant is correctly defined and follows the established pattern for AI provider identifiers.

schema/waveai.json (1)

24-24: LGTM! Schema enum updated correctly.

The "nanogpt" value is properly added to the provider enum and follows the existing naming pattern.

docs/docs/waveai-modes.mdx (2)

37-37: LGTM! Provider list updated correctly.

The NanoGPT entry is properly added to the supported providers list with an anchor link to the detailed section.


234-266: Verify specific model availability on NanoGPT.

The API endpoint (https://nano-gpt.com/api/v1/models?detailed=true) is correct. However, the specific model names referenced—"zai-org/glm-4.7" and "openai/gpt-5"—should be confirmed as available on NanoGPT. While NanoGPT does expose models using provider model IDs, the exact format and current availability of these specific models need to be validated directly against the NanoGPT models list to ensure the documentation examples are accurate.

pkg/wconfig/settingsconfig.go (1)

272-272: LGTM! Jsonschema enum updated correctly.

The "nanogpt" value is properly added to the Provider field's jsonschema enum, maintaining consistency with the JSON schema file.

cmd/testai/main-testai.go (3)

435-435: LGTM!

Documentation and usage examples are consistent with other providers and follow established patterns.

Also applies to: 444-445, 455-455, 462-462


467-467: LGTM!

Flag handling and execution flow are correctly implemented and consistent with existing provider integrations. The conditional logic properly routes to testNanoGPT when the --nanogpt flag is set, and default model selection is handled appropriately.

Also applies to: 472-472, 475-475, 516-517, 542-543


30-30: Verify the model identifier with NanoGPT documentation.

The constant declaration follows established naming patterns, but the model identifier "zai-org/glm-4.7" could not be confirmed against publicly available NanoGPT model listings. Consult the NanoGPT models catalog or API endpoint (/api/v1/models) to confirm this model is available before merging.

@0xGingi
Copy link
Author

0xGingi commented Jan 3, 2026

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #2747

coderabbitai bot added a commit that referenced this pull request Jan 3, 2026
Docstrings generation was requested by @0xGingi.

* #2746 (comment)

The following files were modified:

* `cmd/testai/main-testai.go`
* `pkg/aiusechat/usechat-mode.go`
@sawka
Copy link
Member

sawka commented Jan 6, 2026

@0xGingi thanks for submitting, will take a look. at first glance looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants