Skip to content

Add NEAR AI Cloud provider#5161

Open
PierreLeGuen wants to merge 1 commit into
Aider-AI:mainfrom
PierreLeGuen:nearai-provider
Open

Add NEAR AI Cloud provider#5161
PierreLeGuen wants to merge 1 commit into
Aider-AI:mainfrom
PierreLeGuen:nearai-provider

Conversation

@PierreLeGuen
Copy link
Copy Markdown

Summary

  • Add a native nearai/ model prefix for NEAR AI Cloud TEE inference.
  • Fetch and cache NEAR AI Cloud model metadata from the public catalog for model info and --list-models nearai/.
  • Document NEARAI_API_KEY, the nearai alias, and nearai/... model usage.

Implementation Notes

  • Routes nearai/<model> through LiteLLM's OpenAI-compatible transport using https://cloud-api.near.ai/v1 and NEARAI_API_KEY.
  • Maps max_completion_tokens to max_tokens and strips unsupported OpenAI-only parameters for this provider.
  • Adds focused tests for metadata lookup, request rewriting, default selection, and settings compatibility.

Testing

  • python -m flake8 aider/nearai.py tests/basic/test_nearai.py aider/models.py aider/onboarding.py
  • python -m pytest tests/basic/test_nearai.py tests/basic/test_openrouter.py tests/basic/test_models.py::TestModels::test_model_aliases tests/basic/test_models.py::TestModels::test_configure_model_settings tests/basic/test_onboarding.py::TestOnboarding::test_try_select_default_model_deepseek tests/basic/test_onboarding.py::TestOnboarding::test_try_select_default_model_openai tests/basic/test_main.py::TestMain::test_default_model_selection tests/basic/test_main.py::TestMain::test_api_key_multiple -q
  • aider --list-models nearai/ --no-gitignore --no-check-update
  • aider --model nearai --api-key nearai=fake-key --exit --yes --no-gitignore --no-check-update

A live completion was not run because it requires a real NEARAI_API_KEY.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 21, 2026

CLA assistant check
All committers have signed the CLA.

@PierreLeGuen PierreLeGuen marked this pull request as ready for review May 21, 2026 15:36
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.

2 participants