Add NEAR AI Cloud provider#5161
Open
PierreLeGuen wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nearai/model prefix for NEAR AI Cloud TEE inference.--list-models nearai/.NEARAI_API_KEY, thenearaialias, andnearai/...model usage.Implementation Notes
nearai/<model>through LiteLLM's OpenAI-compatible transport usinghttps://cloud-api.near.ai/v1andNEARAI_API_KEY.max_completion_tokenstomax_tokensand strips unsupported OpenAI-only parameters for this provider.Testing
python -m flake8 aider/nearai.py tests/basic/test_nearai.py aider/models.py aider/onboarding.pypython -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 -qaider --list-models nearai/ --no-gitignore --no-check-updateaider --model nearai --api-key nearai=fake-key --exit --yes --no-gitignore --no-check-updateA live completion was not run because it requires a real
NEARAI_API_KEY.