Skip to content

feat: add Vivgrid provider support#1100

Merged
mengzhuo merged 9 commits intosipeed:mainfrom
zihan987:main
Mar 8, 2026
Merged

feat: add Vivgrid provider support#1100
mengzhuo merged 9 commits intosipeed:mainfrom
zihan987:main

Conversation

@zihan987
Copy link
Copy Markdown
Contributor

@zihan987 zihan987 commented Mar 4, 2026

📝 Description
Adds Vivgrid as a new LLM provider using the OpenAI-compatible endpoint (https://api.vivgrid.com/v1). Vivgrid is an AI Agent and LLM infrastructure platform that helps developers build, deploy, and operate AI-powered applications with speed, reliability, and cost efficiency.

vivgrid-openclaw

Vivgrid exposes an OpenAI-compatible API, so this implementation reuses the existing openai_compat provider
infrastructure.

Files changed:

  • pkg/config/config.go — Vivgrid provider config struct
  • pkg/config/defaults.go — Default model settings for Vivgrid (vivgrid/auto)
  • pkg/config/migration.go — Config migration support
  • pkg/config/migration_test.go — Migration coverage updated
  • pkg/providers/factory.go — Provider selection & fallback inference
  • pkg/providers/factory_provider.go — Factory registration & default API base
  • pkg/providers/factory_test.go — Provider selection test
  • pkg/providers/factory_provider_test.go — Default API base coverage
  • pkg/providers/openai_compat/provider.go — Strips vivgrid/ prefix for OpenAI-compatible calls
  • pkg/providers/openai_compat/provider_test.go — Prefix stripping tests

———

🗣️ Type of Change

  • ✨ New feature (non-breaking change which adds functionality)

———

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

———

Comment thread pkg/config/config.go Outdated
Comment thread pkg/providers/openai_compat/provider.go Outdated
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 5, 2026

CLA assistant check
All committers have signed the CLA.

Comment thread pkg/providers/factory_provider.go
@zihan987 zihan987 requested a review from mengzhuo March 6, 2026 12:47
Copy link
Copy Markdown
Collaborator

@yinwm yinwm left a comment

Choose a reason for hiding this comment

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

Review Summary

Thanks for adding Vivgrid provider support! The implementation follows the existing patterns well and has good test coverage. However, there are a few issues that need to be addressed before merging.


🔴 Must Fix

1. Copy-paste error in README.md (line 942)

| `vivgrid`                  | LLM (Cerebras direct)                   | [vivgrid.com](https://vivgrid.com)                                   |

The description says "Cerebras direct" but it should be "Vivgrid" or "OpenAI-compatible". This is clearly a copy-paste mistake.

2. Table formatting broken in README.md (lines 975-977)

| **神算云**          | `shengsuanyun/`   | `https://router.shengsuanyun.com/api/v1`            | OpenAI    |                       |
| **Vivgrid**         | `vivgrid/`       | `https://api.vivgrid.com/v1`                        | OpenAI    | [Get Key](https://vivgrid.com)                                                             |
  • The 神算云 row is missing the - link column (looks like it was accidentally removed)
  • The Vivgrid row has trailing whitespace after the link

🟡 Suggestions

1. Model inference logic could be more precise (factory.go line 306)

case (strings.Contains(lowerModel, "vivgrid") || strings.HasPrefix(model, "vivgrid/")) && cfg.Providers.Vivgrid.APIKey != "":

Using strings.Contains(lowerModel, "vivgrid") might be too loose. A model named my-vivgrid-model would incorrectly match. Consider using only the prefix check:

case strings.HasPrefix(model, "vivgrid/") && cfg.Providers.Vivgrid.APIKey != "":

2. Extra blank line in docs/migration/model-list-migration.md (line 105)

There's an extra blank line added. Consider removing it for cleaner documentation.


✅ What's Done Well

  • Code structure follows existing provider patterns (consistent with Cerebras, DeepSeek, etc.)
  • Good test coverage for migration, factory, and normalize model functions
  • All necessary files updated (config, factory, provider, tests, docs)

Please fix the README issues and I'll be happy to approve this PR!

@yinwm
Copy link
Copy Markdown
Collaborator

yinwm commented Mar 8, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Copy link
Copy Markdown
Collaborator

@yinwm yinwm left a comment

Choose a reason for hiding this comment

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

LGTM

@mengzhuo mengzhuo merged commit 81dfdf5 into sipeed:main Mar 8, 2026
4 checks passed
dj-oyu pushed a commit to dj-oyu/picoclaw that referenced this pull request Mar 8, 2026
feat: add Vivgrid provider support
@Orgmar
Copy link
Copy Markdown
Contributor

Orgmar commented Mar 9, 2026

@zihan987 Adding Vivgrid as a provider and reusing the openai_compat infrastructure is the right call. Keeps things clean and consistent with how other compatible endpoints are integrated.

We have a PicoClaw Dev Group on Discord where contributors hang out and collaborate. If you'd like to join, send an email to support@sipeed.com with the subject [Join PicoClaw Dev Group] zihan987 and we'll send you the invite!

fishtrees pushed a commit to fishtrees/picoclaw that referenced this pull request Mar 12, 2026
feat: add Vivgrid provider support
dj-oyu pushed a commit to dj-oyu/picoclaw that referenced this pull request Mar 14, 2026
feat: add Vivgrid provider support
andressg79 pushed a commit to andressg79/picoclaw that referenced this pull request Mar 30, 2026
feat: add Vivgrid provider support
ra1phdd pushed a commit to ra1phdd/picoclaw-pkg that referenced this pull request Apr 12, 2026
feat: add Vivgrid provider support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants