@juspay/neurolink 13.16.1 → 13.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/dist/adapters/providerImageAdapter.js +29 -495
  3. package/dist/browser/neurolink.min.js +464 -470
  4. package/dist/constants/contextWindows.js +13 -328
  5. package/dist/constants/enums.d.ts +1 -0
  6. package/dist/constants/enums.js +2 -1
  7. package/dist/context/anthropicLoopGuard.d.ts +1 -1
  8. package/dist/context/anthropicLoopGuard.js +2 -1
  9. package/dist/core/constants.js +6 -53
  10. package/dist/core/geminiLoopAdapter.js +8 -6
  11. package/dist/core/modules/structuredOutputPolicy.d.ts +0 -21
  12. package/dist/core/modules/structuredOutputPolicy.js +4 -54
  13. package/dist/factories/providerDescriptors.js +3 -2
  14. package/dist/factories/providerRegistry.js +3 -2
  15. package/dist/models/manifests/anthropic.d.ts +1 -1
  16. package/dist/models/manifests/anthropic.js +1 -1
  17. package/dist/models/manifests/azure.js +9 -9
  18. package/dist/models/manifests/ollama.js +13 -0
  19. package/dist/models/manifests/openai.d.ts +1 -1
  20. package/dist/models/manifests/openai.js +1 -1
  21. package/dist/models/modelRegistry.js +17 -42
  22. package/dist/providers/amazonBedrock/client.js +9 -37
  23. package/dist/providers/amazonBedrock/loopAdapter.js +3 -11
  24. package/dist/providers/anthropic/client.js +42 -97
  25. package/dist/providers/anthropic/loopAdapter.js +24 -22
  26. package/dist/providers/anthropic/structuredOutput.d.ts +0 -2
  27. package/dist/providers/anthropic/structuredOutput.js +3 -5
  28. package/dist/providers/azureOpenai.js +4 -22
  29. package/dist/providers/catalog/loader.js +12 -25
  30. package/dist/providers/cohere.js +5 -30
  31. package/dist/providers/googleAiStudio/client.js +12 -61
  32. package/dist/providers/googleNativeGemini3/utils.js +43 -102
  33. package/dist/providers/googleVertex/client.js +123 -184
  34. package/dist/providers/litellm/client.js +10 -50
  35. package/dist/providers/llamaCpp.js +4 -15
  36. package/dist/providers/lmStudio.js +9 -14
  37. package/dist/providers/nvidiaNim/client.js +4 -62
  38. package/dist/providers/ollama/client.js +14 -54
  39. package/dist/providers/ollama/constants.d.ts +1 -3
  40. package/dist/providers/ollama/constants.js +2 -3
  41. package/dist/providers/openAI/client.js +5 -57
  42. package/dist/providers/openRouter/client.js +4 -65
  43. package/dist/providers/openaiChatCompletionsBase.js +34 -58
  44. package/dist/providers/openaiChatCompletionsClient.js +17 -57
  45. package/dist/providers/openaiCompatible/client.js +9 -36
  46. package/dist/providers/rules/README.md +100 -0
  47. package/dist/providers/rules/anthropic.json +104 -0
  48. package/dist/providers/rules/azure.json +13 -0
  49. package/dist/providers/rules/bedrock.json +48 -0
  50. package/dist/providers/rules/cohere.json +32 -0
  51. package/dist/providers/rules/credentials.json +34 -0
  52. package/dist/providers/rules/errorRules.d.ts +17 -0
  53. package/dist/providers/rules/errorRules.js +197 -0
  54. package/dist/providers/rules/errorSignals.d.ts +2 -0
  55. package/dist/providers/rules/errorSignals.js +28 -0
  56. package/dist/providers/rules/fallbackModel.d.ts +4 -0
  57. package/dist/providers/rules/fallbackModel.js +21 -0
  58. package/dist/providers/rules/finalResultTool.d.ts +11 -0
  59. package/dist/providers/rules/finalResultTool.js +17 -0
  60. package/dist/providers/rules/finishReasons.d.ts +10 -0
  61. package/dist/providers/rules/finishReasons.js +28 -0
  62. package/dist/providers/rules/gemini.json +92 -0
  63. package/dist/providers/rules/google-ai.json +55 -0
  64. package/dist/providers/rules/limits.json +338 -0
  65. package/dist/providers/rules/litellm.json +36 -0
  66. package/dist/providers/rules/llamacpp.json +23 -0
  67. package/dist/providers/rules/lm-studio.json +21 -0
  68. package/dist/providers/rules/model-families.json +109 -0
  69. package/dist/providers/rules/modelFamilies.d.ts +10 -0
  70. package/dist/providers/rules/modelFamilies.js +45 -0
  71. package/dist/providers/rules/nvidia-nim.json +43 -0
  72. package/dist/providers/rules/ollama.json +37 -0
  73. package/dist/providers/rules/openai-chat.json +66 -0
  74. package/dist/providers/rules/openai-compatible.json +31 -0
  75. package/dist/providers/rules/openai.json +38 -0
  76. package/dist/providers/rules/openrouter.json +57 -0
  77. package/dist/providers/rules/proxy.json +44 -0
  78. package/dist/providers/rules/registry.d.ts +7 -0
  79. package/dist/providers/rules/registry.js +76 -0
  80. package/dist/providers/rules/requestDefaults.d.ts +7 -0
  81. package/dist/providers/rules/requestDefaults.js +9 -0
  82. package/dist/providers/rules/requestFields.d.ts +18 -0
  83. package/dist/providers/rules/requestFields.js +38 -0
  84. package/dist/providers/rules/sagemaker.json +88 -0
  85. package/dist/providers/rules/schema.d.ts +234 -0
  86. package/dist/providers/rules/schema.js +352 -0
  87. package/dist/providers/rules/structured-output.json +36 -0
  88. package/dist/providers/rules/thinkingLimits.d.ts +7 -0
  89. package/dist/providers/rules/thinkingLimits.js +9 -0
  90. package/dist/providers/rules/toolRules.d.ts +16 -0
  91. package/dist/providers/rules/toolRules.js +95 -0
  92. package/dist/providers/rules/usage.json +51 -0
  93. package/dist/providers/rules/vertex.json +65 -0
  94. package/dist/providers/rules/vision.json +505 -0
  95. package/dist/providers/rules/wireUsage.d.ts +38 -0
  96. package/dist/providers/rules/wireUsage.js +82 -0
  97. package/dist/providers/sagemaker/language-model.js +6 -33
  98. package/dist/providers/sagemaker/parsers.js +13 -48
  99. package/dist/providers/sagemaker/streaming.js +9 -16
  100. package/dist/proxy/claudeFormat.js +3 -16
  101. package/dist/proxy/geminiFormat.js +3 -9
  102. package/dist/proxy/openaiFormat.js +3 -16
  103. package/dist/types/index.d.ts +1 -0
  104. package/dist/types/index.js +2 -0
  105. package/dist/types/providerRules.d.ts +407 -0
  106. package/dist/types/providerRules.js +10 -0
  107. package/dist/utils/errorClassifier.d.ts +2 -2
  108. package/dist/utils/errorClassifier.js +3 -2
  109. package/dist/utils/modelDetection.d.ts +1 -1
  110. package/dist/utils/modelDetection.js +30 -71
  111. package/dist/utils/providerConfig.d.ts +10 -9
  112. package/dist/utils/providerConfig.js +26 -25
  113. package/dist/utils/providerHealth.js +1 -0
  114. package/dist/utils/thinkingConfig.d.ts +1 -1
  115. package/dist/utils/thinkingConfig.js +8 -8
  116. package/dist/utils/tokenUtils.d.ts +12 -38
  117. package/dist/utils/tokenUtils.js +44 -127
  118. package/docs-site/static/search-index.json +5 -5
  119. package/package.json +2 -1
  120. package/dist/providers/localRuntimeOpenAICompat.d.ts +0 -16
  121. package/dist/providers/localRuntimeOpenAICompat.js +0 -26
@@ -6117,7 +6117,7 @@
6117
6117
  {"objectID":"7162fa861da3490fb14e0ab695b578a808e63f3479c23c2b34e55a26de99424c","title":"Empty content with finish_reason: \"length\"","url":"/docs/getting-started/providers/nvidia-nim#empty-content-with-finish_reason-length","content":"A reasoning model spent the whole maxTokens budget on its reasoning before it started the answer. The reasoning is in result.reasoning; raise maxTokens (a few hundred tokens is enough for a short answer on openai/gpt-oss-20b).","hierarchy":{"lvl0":"Getting Started","lvl1":"NVIDIA NIM Provider Guide","lvl2":"Empty content with finish_reason: \"length\"","lvl3":""}},
6118
6118
  {"objectID":"403e25d3806bf5242a71a8e510fac16e068f907380e7f22d15d2393cbf3f28f4","title":"Thinking level has no visible effect","url":"/docs/getting-started/providers/nvidia-nim#thinking-level-has-no-visible-effect","content":"On generate(), thinkingLevel is not forwarded to NIM at all; use stream().\nOn stream(), any level except minimal sends the same thinking flags, so low, medium and high behave alike.\nA model that already reasons on every request, such as openai/gpt-oss-20b, returns its trace with or without the flags.\nIf the model rejects reasoning_budget with a 400 that names it, the provider retries once without it. A rejection of thinking or enable_thinking is not retried and comes back as the 400.","hierarchy":{"lvl0":"Getting Started","lvl1":"NVIDIA NIM Provider Guide","lvl2":"Thinking level has no visible effect","lvl3":""}},
6119
6119
  {"objectID":"81d809e5e2f1a5432e211618570e5863285ced65bb39c3837bad507e576cc2b2","title":"See Also","url":"/docs/getting-started/providers/nvidia-nim#see-also","content":"Implementation spec — internal wire-format details and NIM-specific extras\nDeepSeek provider — if you only need DeepSeek-R1 via the official DeepSeek API\nOpenAI Compatible provider — generic provider for any OpenAI-compatible endpoint\n\nNeed Help? Join the GitHub Discussions or open an issue.","hierarchy":{"lvl0":"Getting Started","lvl1":"NVIDIA NIM Provider Guide","lvl2":"See Also","lvl3":""}},
6120
- {"objectID":"ec3ac003bf51ae7a21d4557697635c22addb912b2f8a6812afd05c7617b743fd","title":"Ollama Provider Guide","url":"/docs/getting-started/providers/ollama","content":"Ollama Provider Guide\n\nRun AI models locally with full privacy - no API key or cloud service required\n\nOverview\n\nOllama lets you run open-source large language models entirely on your own machine. NeuroLink integrates with Ollama through a custom OllamaLanguageModel implementation that supports both the native Ollama API (/api/generate) and an OpenAI-compatible mode (/v1/chat/completions).\n\nKey Benefits\n100% Local: All inference runs on your hardware, no data leaves your machine\nNo API Key Required: No accounts, billing, or rate limits\nOffline Capable: Works completely without internet after models are pulled\n70+ Models: Llama, Mistral, Qwen, DeepSeek, Gemma, Phi, CodeLlama, and more\nTool/Function Calling: Multi-step tool execution via the OpenAI-compatible endpoint\nStreaming: Full streaming support in both native and OpenAI-compatible modes\nMultimodal: Image input support for vision-capable models (LLaVA, Llama 3.2)\nProxy-Aware: Supports HTTP/HTTPS proxy configuration\n\nAPI Modes\n\n| Mode | Endpoint | Use Case |\n| --------------------- | ---------------------- | ------------------------------------------------- |\n| Native (default) | /api/generate | Standard text generation and streaming |\n| OpenAI-compatible | /v1/chat/completions | Tool calling, chat-format messages, compatibility |\n\nTool calling always uses the OpenAI-compatible endpoint regardless of the mode setting.\n\nQuick Start\nInstall Ollama\n\nDownload from ollama.ai, open the .dmg, and drag Ollama to Applications.\n\nDownload the installer from ollama.ai and run it. WSL2 is also supported.\nStart Ollama and Pull a Model\nConfigure NeuroLink\n\nAdd to your .env file:\nTest the Setup\n\nSupported Models\n\nAvailable Models (from OllamaModels enum)\n\nAny model in the Ollama library can be used by passing its tag to --model. The OllamaModels enum in src/lib/constants/enums.ts provides named constants for common models:\n\nLlama Series\n\n| Enum Key | Model ID | Description |\n| ----------------- | ----------------- | ---------------------------------------- |\n| LLAMA4_SCOUT | llama4:scout | Llama 4 multimodal with vision and tools |\n| LLAMA4_MAVERICK | llama4:maverick | Llama 4 multimodal with vision and tools |\n| LLAMA3_3_70B | llama3.3:70b | High-performance 70B |\n| LLAMA3_2_LATEST | llama3.2:latest | Optimized for edge deployment (default) |\n| LLAMA3_2_3B | llama3.2:3b | Compact 3B edge model |\n| LLAMA3_2_1B | llama3.2:1b | Ultra-compact 1B model |\n| LLAMA3_1_8B | llama3.1:8b | Open model rivaling proprietary models |\n| LLAMA3_1_70B | llama3.1:70b | Large-scale open model |\n| LLAMA3_1_405B | llama3.1:405b | Largest open Llama model |\n\nQwen Series\n\n| Enum Key | Model ID | Description |\n| ------------- | ------------- | -------------------------------- |\n| QWEN3_4B | qwen3:4b | Advanced reasoning, multilingual |\n| QWEN3_8B | qwen3:8b | Advanced reasoning, multilingual |\n| QWEN3_14B | qwen3:14b | Advanced reasoning, multilingual |\n| QWEN3_32B | qwen3:32b | Advanced reasoning, multilingual |\n| QWEN3_72B | qwen3:72b | Advanced reasoning, multilingual |\n| QWQ_32B | qwq:32b | Reasoning-specialized model |\n| QWEN2_5_72B | qwen2.5:72b | Enhanced coding and mathematics |\n\nDeepSeek Series\n\n| Enum Key | Model ID | Description |\n| -------------------- | -------------------- | -------------------------- |\n| DEEPSEEK_R1_7B | deepseek-r1:7b | State-of-the-art reasoning |\n| DEEPSEEK_R1_14B | deepseek-r1:14b | Reasoning at 14B scale |\n| DEEPSEEK_R1_32B | deepseek-r1:32b | Reasoning at 32B scale |\n| DEEPSEEK_R1_70B | deepseek-r1:70b | Large-scale reasoning |\n| DEEPSEEK_V3_LATEST | deepseek-v3:latest | Mixture of Experts model |\n\nMistral Series\n\n| Enum Key | Model ID | Description |\n| ---------------------- | ---------------------- | ---------------------------- |\n| MISTRAL_LATEST | mistral:latest | Efficient general-purpose 7B |\n| MISTRAL_SMALL_LATEST | mistral-small:latest | Compact Mistral variant |\n| MISTRAL_NEMO_LATEST | mistral-nemo:latest | Nemo architecture |\n| MISTRAL_LARGE_LATEST | mistral-large:latest | Largest Mistral model |\n\nCode-Specialized Models\n\n| Enum Key | Model ID | Description |\n| ------------------- | ------------------- | ------------------------- |\n| CODELLAMA_7B | codellama:7b | Code-focused Llama 7B |\n| CODELLAMA_13B | codellama:13b | Code-focused Llama 13B |\n| CODELLAMA_34B | codellama:34b | Code-focused Llama 34B |\n| CODELLAMA_70B | codellama:70b | Code-focused Llama 70B |\n| QWE","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"","lvl3":""}},
6120
+ {"objectID":"ec3ac003bf51ae7a21d4557697635c22addb912b2f8a6812afd05c7617b743fd","title":"Ollama Provider Guide","url":"/docs/getting-started/providers/ollama","content":"Ollama Provider Guide\n\nRun AI models locally with full privacy - no API key or cloud service required\n\nOverview\n\nOllama lets you run open-source large language models entirely on your own machine. NeuroLink integrates with Ollama through a custom OllamaLanguageModel implementation that supports both the native Ollama API (/api/generate) and an OpenAI-compatible mode (/v1/chat/completions).\n\nKey Benefits\n100% Local: All inference runs on your hardware, no data leaves your machine\nNo API Key Required: No accounts, billing, or rate limits\nOffline Capable: Works completely without internet after models are pulled\n70+ Models: Llama, Mistral, Qwen, DeepSeek, Gemma, Phi, CodeLlama, and more\nTool/Function Calling: Multi-step tool execution via the OpenAI-compatible endpoint\nStreaming: Full streaming support in both native and OpenAI-compatible modes\nMultimodal: Image input support for vision-capable models (LLaVA, Llama 3.2)\nProxy-Aware: Supports HTTP/HTTPS proxy configuration\n\nAPI Modes\n\n| Mode | Endpoint | Use Case |\n| --------------------- | ---------------------- | ------------------------------------------------- |\n| Native (default) | /api/generate | Standard text generation and streaming |\n| OpenAI-compatible | /v1/chat/completions | Tool calling, chat-format messages, compatibility |\n\nTool calling always uses the OpenAI-compatible endpoint regardless of the mode setting.\n\nQuick Start\nInstall Ollama\n\nDownload from ollama.ai, open the .dmg, and drag Ollama to Applications.\n\nDownload the installer from ollama.ai and run it. WSL2 is also supported.\nStart Ollama and Pull a Model\nConfigure NeuroLink\n\nAdd to your .env file:\nTest the Setup\n\nSupported Models\n\nAvailable Models (from OllamaModels enum)\n\nAny model in the Ollama library can be used by passing its tag to --model. The OllamaModels enum in src/lib/constants/enums.ts provides named constants for common models:\n\nLlama Series\n\n| Enum Key | Model ID | Description |\n| ----------------- | ----------------- | ---------------------------------------- |\n| LLAMA4_SCOUT | llama4:scout | Llama 4 multimodal with vision and tools |\n| LLAMA4_MAVERICK | llama4:maverick | Llama 4 multimodal with vision and tools |\n| LLAMA3_3_70B | llama3.3:70b | High-performance 70B |\n| LLAMA3_2_LATEST | llama3.2:latest | Optimized for edge deployment |\n| LLAMA3_2_3B | llama3.2:3b | Compact 3B edge model |\n| LLAMA3_2_1B | llama3.2:1b | Ultra-compact 1B model |\n| LLAMA3_1_8B | llama3.1:8b | Open model rivaling proprietary models |\n| LLAMA3_1_70B | llama3.1:70b | Large-scale open model |\n| LLAMA3_1_405B | llama3.1:405b | Largest open Llama model |\n\nQwen Series\n\n| Enum Key | Model ID | Description |\n| ------------- | ------------- | -------------------------------- |\n| QWEN3_4B | qwen3:4b | Advanced reasoning, multilingual |\n| QWEN3_8B | qwen3:8b | Advanced reasoning, multilingual |\n| QWEN3_14B | qwen3:14b | Advanced reasoning, multilingual |\n| QWEN3_32B | qwen3:32b | Advanced reasoning, multilingual |\n| QWEN3_72B | qwen3:72b | Advanced reasoning, multilingual |\n| QWQ_32B | qwq:32b | Reasoning-specialized model |\n| QWEN2_5_72B | qwen2.5:72b | Enhanced coding and mathematics |\n\nDeepSeek Series\n\n| Enum Key | Model ID | Description |\n| -------------------- | -------------------- | -------------------------- |\n| DEEPSEEK_R1_7B | deepseek-r1:7b | State-of-the-art reasoning |\n| DEEPSEEK_R1_14B | deepseek-r1:14b | Reasoning at 14B scale |\n| DEEPSEEK_R1_32B | deepseek-r1:32b | Reasoning at 32B scale |\n| DEEPSEEK_R1_70B | deepseek-r1:70b | Large-scale reasoning |\n| DEEPSEEK_V3_LATEST | deepseek-v3:latest | Mixture of Experts model |\n\nMistral Series\n\n| Enum Key | Model ID | Description |\n| ---------------------- | ---------------------- | ---------------------------- |\n| MISTRAL_LATEST | mistral:latest | Efficient general-purpose 7B |\n| MISTRAL_SMALL_LATEST | mistral-small:latest | Compact Mistral variant |\n| MISTRAL_NEMO_LATEST | mistral-nemo:latest | Nemo architecture |\n| MISTRAL_LARGE_LATEST | mistral-large:latest | Largest Mistral model |\n\nCode-Specialized Models\n\n| Enum Key | Model ID | Description |\n| ------------------- | ------------------- | ------------------------- |\n| CODELLAMA_7B | codellama:7b | Code-focused Llama 7B |\n| CODELLAMA_13B | codellama:13b | Code-focused Llama 13B |\n| CODELLAMA_34B | codellama:34b | Code-focused Llama 34B |\n| CODELLAMA_70B | codellama:70b | Code-focused Llama 70B |\n| QWE","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"","lvl3":""}},
6121
6121
  {"objectID":"279448d05aa41576a8f2d67b977f92d561f583abcce219892e3dea61565b5d4d","title":"Ollama Provider Guide","url":"/docs/getting-started/providers/ollama#ollama-provider-guide","content":"Run AI models locally with full privacy - no API key or cloud service required","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Ollama Provider Guide","lvl3":""}},
6122
6122
  {"objectID":"02dd6464ae6c5dbe55465f143cc847f5d630c86c7a79cdbe3e6b37c524b7be29","title":"Overview","url":"/docs/getting-started/providers/ollama#overview","content":"Ollama lets you run open-source large language models entirely on your own machine. NeuroLink integrates with Ollama through a custom OllamaLanguageModel implementation that supports both the native Ollama API (/api/generate) and an OpenAI-compatible mode (/v1/chat/completions).","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Overview","lvl3":""}},
6123
6123
  {"objectID":"1132be8d38657788b1e604e7b3a07ec395971486c501d8dcd605a865588c7224","title":"Key Benefits","url":"/docs/getting-started/providers/ollama#key-benefits","content":"100% Local: All inference runs on your hardware, no data leaves your machine\nNo API Key Required: No accounts, billing, or rate limits\nOffline Capable: Works completely without internet after models are pulled\n70+ Models: Llama, Mistral, Qwen, DeepSeek, Gemma, Phi, CodeLlama, and more\nTool/Function Calling: Multi-step tool execution via the OpenAI-compatible endpoint\nStreaming: Full streaming support in both native and OpenAI-compatible modes\nMultimodal: Image input support for vision-capable models (LLaVA, Llama 3.2)\nProxy-Aware: Supports HTTP/HTTPS proxy configuration","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Key Benefits","lvl3":""}},
@@ -6127,14 +6127,14 @@
6127
6127
  {"objectID":"2a8c473ad90d636ca164d7f07cbef2fbbcb4db134e119545975286f3b45ab333","title":"3. Configure NeuroLink","url":"/docs/getting-started/providers/ollama#3-configure-neurolink","content":"Add to your .env file:","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"3. Configure NeuroLink","lvl3":""}},
6128
6128
  {"objectID":"24a2a5855b83e1bfa8b028cc0b226b6788407d9301ea46d8055f1d96e3001ee6","title":"4. Test the Setup","url":"/docs/getting-started/providers/ollama#4-test-the-setup","content":"4. Test the Setup","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"4. Test the Setup","lvl3":""}},
6129
6129
  {"objectID":"f4e1772cf2e25016b5683048780f6289fa45aa5aab0efde2751843a32c58badd","title":"Available Models (from OllamaModels enum)","url":"/docs/getting-started/providers/ollama#available-models-from-ollamamodels-enum","content":"Any model in the Ollama library can be used by passing its tag to --model. The OllamaModels enum in src/lib/constants/enums.ts provides named constants for common models:","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Available Models (from OllamaModels enum)","lvl3":""}},
6130
- {"objectID":"36e9f397dc35559b1dcf82f086b282d217e01681dd7360c10304a34c73582f1b","title":"Llama Series","url":"/docs/getting-started/providers/ollama#llama-series","content":"| Enum Key | Model ID | Description |\n| ----------------- | ----------------- | ---------------------------------------- |\n| LLAMA4_SCOUT | llama4:scout | Llama 4 multimodal with vision and tools |\n| LLAMA4_MAVERICK | llama4:maverick | Llama 4 multimodal with vision and tools |\n| LLAMA3_3_70B | llama3.3:70b | High-performance 70B |\n| LLAMA3_2_LATEST | llama3.2:latest | Optimized for edge deployment (default) |\n| LLAMA3_2_3B | llama3.2:3b | Compact 3B edge model |\n| LLAMA3_2_1B | llama3.2:1b | Ultra-compact 1B model |\n| LLAMA3_1_8B | llama3.1:8b | Open model rivaling proprietary models |\n| LLAMA3_1_70B | llama3.1:70b | Large-scale open model |\n| LLAMA3_1_405B | llama3.1:405b | Largest open Llama model |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Llama Series","lvl3":""}},
6130
+ {"objectID":"36e9f397dc35559b1dcf82f086b282d217e01681dd7360c10304a34c73582f1b","title":"Llama Series","url":"/docs/getting-started/providers/ollama#llama-series","content":"| Enum Key | Model ID | Description |\n| ----------------- | ----------------- | ---------------------------------------- |\n| LLAMA4_SCOUT | llama4:scout | Llama 4 multimodal with vision and tools |\n| LLAMA4_MAVERICK | llama4:maverick | Llama 4 multimodal with vision and tools |\n| LLAMA3_3_70B | llama3.3:70b | High-performance 70B |\n| LLAMA3_2_LATEST | llama3.2:latest | Optimized for edge deployment |\n| LLAMA3_2_3B | llama3.2:3b | Compact 3B edge model |\n| LLAMA3_2_1B | llama3.2:1b | Ultra-compact 1B model |\n| LLAMA3_1_8B | llama3.1:8b | Open model rivaling proprietary models |\n| LLAMA3_1_70B | llama3.1:70b | Large-scale open model |\n| LLAMA3_1_405B | llama3.1:405b | Largest open Llama model |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Llama Series","lvl3":""}},
6131
6131
  {"objectID":"62e289aace53b2fd96a0a4d94b2fd7415b06e0808168001fb5b2422ddc0ed0eb","title":"Qwen Series","url":"/docs/getting-started/providers/ollama#qwen-series","content":"| Enum Key | Model ID | Description |\n| ------------- | ------------- | -------------------------------- |\n| QWEN3_4B | qwen3:4b | Advanced reasoning, multilingual |\n| QWEN3_8B | qwen3:8b | Advanced reasoning, multilingual |\n| QWEN3_14B | qwen3:14b | Advanced reasoning, multilingual |\n| QWEN3_32B | qwen3:32b | Advanced reasoning, multilingual |\n| QWEN3_72B | qwen3:72b | Advanced reasoning, multilingual |\n| QWQ_32B | qwq:32b | Reasoning-specialized model |\n| QWEN2_5_72B | qwen2.5:72b | Enhanced coding and mathematics |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Qwen Series","lvl3":""}},
6132
6132
  {"objectID":"37c2418291749103f288e85c7a4ab72dea4e6334e33fbfddd2b5979ffb7ae9b0","title":"DeepSeek Series","url":"/docs/getting-started/providers/ollama#deepseek-series","content":"| Enum Key | Model ID | Description |\n| -------------------- | -------------------- | -------------------------- |\n| DEEPSEEK_R1_7B | deepseek-r1:7b | State-of-the-art reasoning |\n| DEEPSEEK_R1_14B | deepseek-r1:14b | Reasoning at 14B scale |\n| DEEPSEEK_R1_32B | deepseek-r1:32b | Reasoning at 32B scale |\n| DEEPSEEK_R1_70B | deepseek-r1:70b | Large-scale reasoning |\n| DEEPSEEK_V3_LATEST | deepseek-v3:latest | Mixture of Experts model |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"DeepSeek Series","lvl3":""}},
6133
6133
  {"objectID":"59b6d2ed026f61c1bce527fa9f736d42c6c4334965b59745ef8b349dd9e57ba3","title":"Mistral Series","url":"/docs/getting-started/providers/ollama#mistral-series","content":"| Enum Key | Model ID | Description |\n| ---------------------- | ---------------------- | ---------------------------- |\n| MISTRAL_LATEST | mistral:latest | Efficient general-purpose 7B |\n| MISTRAL_SMALL_LATEST | mistral-small:latest | Compact Mistral variant |\n| MISTRAL_NEMO_LATEST | mistral-nemo:latest | Nemo architecture |\n| MISTRAL_LARGE_LATEST | mistral-large:latest | Largest Mistral model |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Mistral Series","lvl3":""}},
6134
6134
  {"objectID":"d3128607fca4218542530e76ac8ebe8cde64aa8789ec39a8d865f5c84b4e099d","title":"Code-Specialized Models","url":"/docs/getting-started/providers/ollama#code-specialized-models","content":"| Enum Key | Model ID | Description |\n| ------------------- | ------------------- | ------------------------- |\n| CODELLAMA_7B | codellama:7b | Code-focused Llama 7B |\n| CODELLAMA_13B | codellama:13b | Code-focused Llama 13B |\n| CODELLAMA_34B | codellama:34b | Code-focused Llama 34B |\n| CODELLAMA_70B | codellama:70b | Code-focused Llama 70B |\n| QWEN2_5_CODER_7B | qwen2.5-coder:7b | Qwen coding model |\n| QWEN2_5_CODER_32B | qwen2.5-coder:32b | Qwen coding model (large) |\n| STARCODER2_3B | starcoder2:3b | Compact code generation |\n| STARCODER2_15B | starcoder2:15b | Larger code generation |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Code-Specialized Models","lvl3":""}},
6135
6135
  {"objectID":"6020005c264ae68ddd1c734809459335f2a76492f6d3113dc7db852861901884","title":"Vision-Language Models","url":"/docs/getting-started/providers/ollama#vision-language-models","content":"| Enum Key | Model ID | Description |\n| ----------------- | ----------------- | --------------------------- |\n| LLAVA_7B | llava:7b | Vision-language 7B |\n| LLAVA_13B | llava:13b | Vision-language 13B |\n| LLAVA_34B | llava:34b | Vision-language 34B |\n| LLAVA_LLAMA3_8B | llava-llama3:8b | LLaVA with Llama 3 backbone |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Vision-Language Models","lvl3":""}},
6136
- {"objectID":"5a72a5e0e544f778361d02abaa33f509cde8cfdaaf1e7dba9e8cf52918727752","title":"Other Notable Models","url":"/docs/getting-started/providers/ollama#other-notable-models","content":"| Enum Key | Model ID | Description |\n| ------------------------ | ------------------------ | ----------------------------- |\n| GEMMA3_LATEST | gemma3:latest | Google Gemma 3 |\n| GEMMA2_27B | gemma2:27b | Google Gemma 2 large |\n| PHI4_LATEST | phi4:latest | Microsoft Phi 4 |\n| PHI3_MINI | phi3:mini | Microsoft Phi 3 compact |\n| MIXTRAL_8X7B | mixtral:8x7b | Mixture of Experts |\n| MIXTRAL_8X22B | mixtral:8x22b | Large Mixture of Experts |\n| COMMAND_R_PLUS | command-r-plus:104b | Cohere enterprise model |\n| GLM_5_LATEST | glm-5:latest | Z.AI flagship reasoning |\n| NEMOTRON_3_NANO_LATEST | nemotron-3-nano:latest | NVIDIA hybrid MoE, 1M context |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Other Notable Models","lvl3":""}},
6137
- {"objectID":"d26dd6af0acc7fa7e6ef87c6071c94b30470ec83bafa31968aff1d4eb4a0fd00","title":"Default Model","url":"/docs/getting-started/providers/ollama#default-model","content":"The default model is llama3.2:latest (set via OllamaModels.LLAMA3_2_LATEST in the provider registry). The internal OllamaLanguageModel uses llama3.1:8b as its default with llama3.2:latest as a fallback when the primary model fails. Override the default with the OLLAMA_MODEL environment variable.\n\nModel names are matched by prefix, so llama3.2 will match llama3.2:latest on your Ollama instance. This also means gemma3:27b matches gemma3:27b-fp16.","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Default Model","lvl3":""}},
6136
+ {"objectID":"5a72a5e0e544f778361d02abaa33f509cde8cfdaaf1e7dba9e8cf52918727752","title":"Other Notable Models","url":"/docs/getting-started/providers/ollama#other-notable-models","content":"| Enum Key | Model ID | Description |\n| ------------------------ | ------------------------ | ----------------------------- |\n| GEMMA4_E2B | gemma4:e2b | Google Gemma 4 edge (default) |\n| GEMMA3_LATEST | gemma3:latest | Google Gemma 3 |\n| GEMMA2_27B | gemma2:27b | Google Gemma 2 large |\n| PHI4_LATEST | phi4:latest | Microsoft Phi 4 |\n| PHI3_MINI | phi3:mini | Microsoft Phi 3 compact |\n| MIXTRAL_8X7B | mixtral:8x7b | Mixture of Experts |\n| MIXTRAL_8X22B | mixtral:8x22b | Large Mixture of Experts |\n| COMMAND_R_PLUS | command-r-plus:104b | Cohere enterprise model |\n| GLM_5_LATEST | glm-5:latest | Z.AI flagship reasoning |\n| NEMOTRON_3_NANO_LATEST | nemotron-3-nano:latest | NVIDIA hybrid MoE, 1M context |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Other Notable Models","lvl3":""}},
6137
+ {"objectID":"d26dd6af0acc7fa7e6ef87c6071c94b30470ec83bafa31968aff1d4eb4a0fd00","title":"Default Model","url":"/docs/getting-started/providers/ollama#default-model","content":"The default model is gemma4:e2b, the model Ollama's own quickstart runs first. It is set by defaultModel in src/lib/providers/rules/ollama.json, and the same file's fallbackModel (also gemma4:e2b) is the model suggested when a requested model is not installed. Override the default with the OLLAMA_MODEL environment variable.\n\nModel names are matched by prefix, so llama3.2 will match llama3.2:latest on your Ollama instance. This also means gemma3:27b matches gemma3:27b-fp16.","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Default Model","lvl3":""}},
6138
6138
  {"objectID":"250d33ed8b268d8db88e761acb2cd53f95390dd93860322da45fbd51c9f363b7","title":"Model Selection by Use Case","url":"/docs/getting-started/providers/ollama#model-selection-by-use-case","content":"Model Selection by Use Case","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Model Selection by Use Case","lvl3":""}},
6139
6139
  {"objectID":"8ad104ffc3051d55a28a645f9db51b26f43ced34874853607adc27d742d1a53a","title":"Model Recommendations by System Resources","url":"/docs/getting-started/providers/ollama#model-recommendations-by-system-resources","content":"| RAM | Recommended Models |\n| ------ | -------------------------------------------------------------- |\n| 8 GB | llama3.2:1b, phi3:mini, gemma2:2b |\n| 16 GB | llama3.1:8b, mistral:latest, codellama:7b, qwen3:8b |\n| 32 GB+ | llama3.3:70b, mixtral:8x7b, deepseek-r1:32b, qwen3:32b |\n| 64 GB+ | llama3.1:405b, mixtral:8x22b, deepseek-v3:latest |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Model Recommendations by System Resources","lvl3":""}},
6140
6140
  {"objectID":"aa604a0bb0d671822570c847fb7cf8fefbcc52a83dc428a10b70cf1d76b1d86b","title":"Provider Aliases","url":"/docs/getting-started/providers/ollama#provider-aliases","content":"The Ollama provider is registered with the following aliases in the provider registry:\n\n| Alias | Description |\n| -------- | ---------------------------------- |\n| ollama | Primary provider name |\n| local | Convenience alias for local models |\n\nBoth aliases resolve to the same OllamaProvider. Use either in the --provider flag or the provider option:","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Provider Aliases","lvl3":""}},
@@ -6149,7 +6149,7 @@
6149
6149
  {"objectID":"d271fd89b925214b43b581cc618c4fa152d537688e04c9ab1b3f3f84f848101a","title":"Multi-Step Tool Execution","url":"/docs/getting-started/providers/ollama#multi-step-tool-execution","content":"The provider supports multi-step tool execution with a configurable maximum number of iterations (controlled by maxSteps, defaulting to DEFAULT_MAX_STEPS). In each iteration:\nThe model receives the conversation history and available tools\nIf the model returns tool calls, NeuroLink executes them automatically\nTool results are appended to the conversation history\nThe model is called again with the updated context\nThis repeats until the model returns a final text response or the iteration limit is reached","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Multi-Step Tool Execution","lvl3":""}},
6150
6150
  {"objectID":"07730b255170f8410fd0894e2b537ec418b4be75dc6aa3f1799ce252bf100f27","title":"Streaming Responses","url":"/docs/getting-started/providers/ollama#streaming-responses","content":"Streaming is supported in both native and OpenAI-compatible modes.\n\nThe provider performs a health check (GET /api/version) before each streaming request to give an early, actionable error if Ollama is not running.","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Streaming Responses","lvl3":""}},
6151
6151
  {"objectID":"30739512ed9bf8c728c49e578cac5c31bb89068bfc118212732ba4e952c2cc5e","title":"Image Analysis","url":"/docs/getting-started/providers/ollama#image-analysis","content":"Vision-capable models (LLaVA, Llama 3.2 vision variants) can analyze images. In native mode, images are sent as base64-encoded data in the Ollama images field. In OpenAI-compatible mode, images are converted to text descriptions.\n\nOllama has no native PDF input, so NeuroLink renders each page to an image and\nsends those instead. This means PDFs work, but only with a vision model such\nas llava:7b — a text-only model receives nothing usable.\n\nThe image fallback converts at most the first 20 pages (a token-overflow\nguard in the message builder) and costs one image per converted page. Anything\npast page 20 is not sent at all, so for longer documents use a provider with\nnative PDF support — OpenAI, Anthropic, Google Vertex AI or Google AI Studio.","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Image Analysis","lvl3":""}},
6152
- {"objectID":"aca0a8c5e4ca52010a5d300a72540b587b5c5e90840d32ee3873b757d5f1f26e","title":"Environment Variables","url":"/docs/getting-started/providers/ollama#environment-variables","content":"| Variable | Description | Default | Required |\n| ---------------------------- | ---------------------------------------------------------------- | --------------------------- | -------- |\n| OLLAMA_BASE_URL | Base URL for the Ollama API | http://localhost:11434 | No |\n| OLLAMA_MODEL | Default model to use | llama3.2:latest | No |\n| OLLAMA_TIMEOUT | Request timeout in milliseconds | 240000 (4 minutes) | No |\n| OLLAMA_OPENAI_COMPATIBLE | Set to true to use the OpenAI-compatible API endpoint | false | No |\n| OLLAMA_TOOL_CAPABLE_MODELS | Comma-separated list of model patterns that support tool calling | (empty, all models assumed) | No |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Environment Variables","lvl3":""}},
6152
+ {"objectID":"aca0a8c5e4ca52010a5d300a72540b587b5c5e90840d32ee3873b757d5f1f26e","title":"Environment Variables","url":"/docs/getting-started/providers/ollama#environment-variables","content":"| Variable | Description | Default | Required |\n| ---------------------------- | ---------------------------------------------------------------- | --------------------------- | -------- |\n| OLLAMA_BASE_URL | Base URL for the Ollama API | http://localhost:11434 | No |\n| OLLAMA_MODEL | Default model to use | gemma4:e2b | No |\n| OLLAMA_TIMEOUT | Request timeout in milliseconds | 240000 (4 minutes) | No |\n| OLLAMA_OPENAI_COMPATIBLE | Set to true to use the OpenAI-compatible API endpoint | false | No |\n| OLLAMA_TOOL_CAPABLE_MODELS | Comma-separated list of model patterns that support tool calling | (empty, all models assumed) | No |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Environment Variables","lvl3":""}},
6153
6153
  {"objectID":"4eed29782fa814fa1659488b96ea6c8d345ddb28cdc95e92f07f025838e889e0","title":"CLI Provider Options","url":"/docs/getting-started/providers/ollama#cli-provider-options","content":"| Flag | Values | Description |\n| ------------------- | -------------------- | ----------------------- |\n| --provider / -p | ollama or local | Use Ollama provider |\n| --model / -m | Any Ollama model tag | Specific model to use |\n| --image | File path | Image for vision models |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"CLI Provider Options","lvl3":""}},
6154
6154
  {"objectID":"13c9b9988e0ec71cefed730d1f397608f6446d5b7befb6e466f0431a24ddc910","title":"Error Handling","url":"/docs/getting-started/providers/ollama#error-handling","content":"The Ollama provider maps errors to specific error types with actionable guidance:\n\n| Error Type | Condition |\n| ------------------- | ----------------------------------------------------------- |\n| NetworkError | Connection refused (Ollama not running), endpoint not found |\n| InvalidModelError | Requested model not pulled locally |\n| TimeoutError | Request exceeded the configured timeout |\n| ProviderError | Other Ollama-side failures |","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"Error Handling","lvl3":""}},
6155
6155
  {"objectID":"a7e9b7d6a16e85278dcdd601b592d15f5c1b1a6683705d5a75578bc56be2fe92","title":"\"Connection refused\" / Ollama not running","url":"/docs/getting-started/providers/ollama#connection-refused-ollama-not-running","content":"The most common error. The provider checks OLLAMA_BASE_URL (default http://localhost:11434) and will fail if Ollama is not serving.\n\nIf Ollama is running on a different host or port:","hierarchy":{"lvl0":"Getting Started","lvl1":"Ollama Provider Guide","lvl2":"\"Connection refused\" / Ollama not running","lvl3":""}},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "13.16.1",
3
+ "version": "13.17.0",
4
4
  "packageManager": "pnpm@10.34.9+sha512.f49b5a8ea0fdedb44bb3c0c1d6575092a53c2950d95b7ad15df11f17974877a2de3a01c07e934e9b28ce716e51c09a94962c7306d09be2e1e4b18a8c8762fd32",
5
5
  "description": "The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002/call) for routing, tool selection and context budgeting. MCP-native (4 transports), voice TTS/STT/realtime, RAG, agents, memory, compaction, 9 observability exporters. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · TypeSafe Jev and more.",
6
6
  "author": {
@@ -197,6 +197,7 @@
197
197
  "test:ollama-diagnostics": "pnpm exec tsx test/continuous-test-suite-ollama-diagnostics.ts",
198
198
  "test:decide-engine": "pnpm exec tsx test/continuous-test-suite-decide-engine.ts",
199
199
  "test:provider-structure": "pnpm exec tsx test/continuous-test-suite-provider-structure.ts",
200
+ "test:provider-rules": "pnpm exec tsx test/continuous-test-suite-provider-rules.ts",
200
201
  "test:provider-tool-sites": "pnpm exec tsx test/continuous-test-suite-provider-tool-sites.ts",
201
202
  "test:model-manifests": "pnpm exec tsx test/continuous-test-suite-model-manifests.ts",
202
203
  "test:cli-models-list": "pnpm exec tsx test/continuous-test-suite-cli-models-list.ts",
@@ -1,16 +0,0 @@
1
- import type { ProviderErrorRule } from "../types/index.js";
2
- /**
3
- * Shared error-rule builder for local-runtime OpenAI-compatible providers —
4
- * Ollama, LM Studio, llama.cpp. All three had byte-identical connection-
5
- * refused predicates (including the duck-typed `code`/`cause.code`
6
- * extraction, since none of that lives on ProviderErrorContext) before this
7
- * factored it out. A plain function, not a shared base class: the
8
- * `neurolink/provider-base-class` lint rule requires every provider to
9
- * extend BaseProvider or OpenAIChatCompletionsProvider directly, so the
10
- * three keep their existing class hierarchy and just call this from their
11
- * own `formatProviderError()`.
12
- *
13
- * `message` stays per-vendor (each provider's own exact wording, unchanged)
14
- * — only the match predicate and errorClass were ever duplicated.
15
- */
16
- export declare function buildLocalUnreachableErrorRule(error: unknown, message: () => string): ProviderErrorRule;
@@ -1,26 +0,0 @@
1
- import { NetworkError } from "../types/index.js";
2
- /**
3
- * Shared error-rule builder for local-runtime OpenAI-compatible providers —
4
- * Ollama, LM Studio, llama.cpp. All three had byte-identical connection-
5
- * refused predicates (including the duck-typed `code`/`cause.code`
6
- * extraction, since none of that lives on ProviderErrorContext) before this
7
- * factored it out. A plain function, not a shared base class: the
8
- * `neurolink/provider-base-class` lint rule requires every provider to
9
- * extend BaseProvider or OpenAIChatCompletionsProvider directly, so the
10
- * three keep their existing class hierarchy and just call this from their
11
- * own `formatProviderError()`.
12
- *
13
- * `message` stays per-vendor (each provider's own exact wording, unchanged)
14
- * — only the match predicate and errorClass were ever duplicated.
15
- */
16
- export function buildLocalUnreachableErrorRule(error, message) {
17
- const errorRecord = error;
18
- const cause = errorRecord?.cause ?? {};
19
- const code = (errorRecord?.code ?? cause?.code);
20
- return {
21
- match: (ctx) => code === "ECONNREFUSED" ||
22
- /ECONNREFUSED|Failed to fetch|fetch failed/.test(ctx.message),
23
- errorClass: NetworkError,
24
- message,
25
- };
26
- }