feat(core): add NEAR AI model provider

PI
5mo ago
+325-3

PR Checklist

  • The commit message follows the contribution guidelines
  • Related issue(s) linked
  • Tests for the changes have been added
  • Docs have been added / updated
  • Changesets have been added

What is the current behavior?

NEAR AI Cloud is not included in VoltAgent's bundled model router registry, so users need to configure it manually as an OpenAI-compatible provider.

What is the new behavior?

Adds nearai as an OpenAI-compatible model router provider with NEARAI_API_KEY and the default base URL https://cloud-api.near.ai/v1. The change also adds NEAR model and embedding type entries, provider docs, and a focused registry test.

For the NEAR route, the OpenAI-compatible request body is adjusted to avoid unsupported strict/advanced fields while keeping the existing adapter path.

Notes for reviewers

The model list follows the current nearai entry from the models.dev registry source used by VoltAgent's bundled provider snapshot. I did not run a live NEAR request locally.

Testing:

  • pnpm --filter @voltagent/internal build
  • pnpm --filter @voltagent/core exec vitest run src/registries/model-provider-registry-nearai.spec.ts src/registries/model-provider-registry-minimax.spec.ts
  • pnpm --filter @voltagent/core typecheck
  • pnpm biome check packages/core/src/registries/model-provider-registry.ts packages/core/src/registries/model-provider-registry-nearai.spec.ts packages/core/src/registries/model-provider-registry.generated.ts packages/core/src/registries/model-provider-types.generated.ts packages/core/src/registries/embedding-model-router-types.generated.ts
  • pnpm exec prettier --check website/models-docs/providers/nearai.md website/models-docs/providers/overview.md website/models-docs/overview.md website/docs/getting-started/providers-models.md .changeset/nearai-provider.md

Summary by CodeRabbit

  • New Features

    • Added NEAR AI Cloud provider (OpenAI‑compatible) with support for numerous model families (Qwen, Anthropic, FLUX.2, Gemini, OpenAI, Whisper, GLM). Use nearai/ routing.
  • Configuration

    • Introduced NEARAI_API_KEY for authentication and optional NEARAI_BASE_URL to override the default API endpoint.
  • Documentation

    • Added NEAR AI Cloud provider docs and updated providers/models overview and counts.

Review Change Stack