NEAR AI for Copilot
Use models from NEAR AI Cloud in the native Visual Studio Code Chat and GitHub Copilot model picker, with TEE-backed providers shown by default.
The extension selects TEE providers from NEAR AI's current model catalog, streams responses from the OpenAI-compatible Chat Completions API, and supports agent tool calls and image input when the selected model advertises those capabilities. Models owned by ordinary proxied providers are not shown.
Setup
- Create an API key in the NEAR AI Cloud dashboard.
- In VS Code, run Chat: Manage Language Models from the Command Palette.
- Select NEAR AI and enter the API key. VS Code stores the value as a secret.
- Enable the NEAR AI models you want to see in the model picker.
- Open Chat and select a model from the NEAR AI group.
Commands
- NEAR AI: Refresh Models reloads the model catalog.
- NEAR AI: Toggle Non-TEE Models switches between the default TEE-only catalog and all ready chat models, then refreshes the model picker.
- NEAR AI: Open Dashboard opens the NEAR AI Cloud dashboard for keys, credits, and usage.
Non-TEE models are hidden by default. The toggle command persists the choice in the near-ai.showOtherModels machine setting. Models outside the nearai and attested 3p owner groups can have different privacy and retention guarantees.
Supported behavior
- Dynamic model discovery and capability metadata, with TEE-backed providers shown by default
- Streaming text responses
- Copilot agent tool calls and tool results
- Image input for models that advertise image support
- Request cancellation
- Exact usage reporting after inference
- Pre-request token estimation calibrated from returned prompt usage
Reasoning tokens are included in API usage when the model reports them, but private reasoning content is not rendered as answer text.
Privacy and billing
Requests are billed to your NEAR AI Cloud account. The extension sends conversation context, tool schemas, tool results, and attached supported images to NEAR AI Cloud only when you select a NEAR AI model.
The NEAR AI catalog contains both TEE-hosted models and models proxied to ordinary third-party providers. This extension treats the catalog owners nearai and attested 3p as TEE-backed. It does not yet cryptographically verify attestation reports or per-response signatures.
Development
npm install
npm run check
For an opt-in live API smoke test, copy .env.example to .env, set NEAR_API_KEY, and run:
npm run test:live
Pass a model ID to diagnose a specific catalog entry:
npm run test:live -- deepseek/deepseek-v4.1-flash
The live test prefers the inexpensive z-ai/glm-5.3-flash model, disables reasoning, and performs one short streamed completion plus one forced tool-call request. If that model is unavailable, it uses the lowest-priced ready tool-capable model in the live catalog. These requests consume a small amount of account credit. .env files are excluded from version control and VSIX packages.
Press F5 in VS Code to launch an Extension Development Host. To create an installable package:
npm run package
The package is written to near-ai-for-copilot.vsix.
License
MIT