@juspay/neurolink 12.43.3 → 12.44.1
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.
- package/CHANGELOG.md +3 -2
- package/README.md +94 -71
- package/dist/browser/neurolink.min.js +393 -393
- package/dist/cli/commands/decide.d.ts +1 -1
- package/dist/cli/commands/decide.js +3 -3
- package/dist/cli/commands/setup.js +2 -1
- package/dist/cli/factories/commandFactory.js +1 -1
- package/dist/constants/enums.d.ts +13 -0
- package/dist/constants/enums.js +14 -0
- package/dist/factories/providerDescriptors.d.ts +8 -2
- package/dist/factories/providerDescriptors.js +75 -5
- package/dist/factories/providerRegistry.js +11 -1
- package/dist/models/manifestRegistry.js +2 -0
- package/dist/models/manifests/perplexityDecider.d.ts +14 -0
- package/dist/models/manifests/perplexityDecider.js +32 -0
- package/dist/neurolink.d.ts +13 -0
- package/dist/neurolink.js +57 -2
- package/dist/providers/perplexityDecider.d.ts +50 -0
- package/dist/providers/perplexityDecider.js +373 -0
- package/dist/providers/systemOneDecision.d.ts +12 -0
- package/dist/providers/systemOneDecision.js +48 -4
- package/dist/types/classifierRouter.d.ts +7 -5
- package/dist/types/cli.d.ts +2 -1
- package/dist/types/decision.d.ts +5 -0
- package/dist/types/providers.d.ts +11 -0
- package/dist/utils/decisionBatches.d.ts +24 -0
- package/dist/utils/decisionBatches.js +58 -0
- package/dist/utils/logSanitize.js +12 -0
- package/dist/utils/modelChoices.js +9 -1
- package/dist/utils/pricing.js +8 -0
- package/dist/utils/providerConfig.d.ts +6 -0
- package/dist/utils/providerConfig.js +18 -0
- package/docs-site/static/search-index.json +82 -59
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
## [12.
|
|
1
|
+
## [12.44.1](https://github.com/juspay/neurolink/compare/v12.44.0...v12.44.1) (2026-10-02)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
- **(
|
|
5
|
+
- **(decide):** split decision requests at a provider's question cap in tryDecide ([42b258b](https://github.com/juspay/neurolink/commit/42b258b4c16a5376a480ff3cdd854ec3776e3aa4))
|
|
6
|
+
- **(logging):** redact the password of a scheme-less user:pass@host in redactUrlForError ([fb996a8](https://github.com/juspay/neurolink/commit/fb996a80cfec91a67bf06c6def24eb7be3096761))
|
|
6
7
|
|
|
7
8
|
## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
|
|
8
9
|
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ const decision = await pipe.tryDecide({
|
|
|
47
47
|
|
|
48
48
|
**NeuroLink is the pipe layer of an AI nervous system.** Providers — OpenAI, Anthropic, Google, AWS, Azure, Mistral, local runtimes like Ollama, and dozens more — are the neurons: each generates a different kind of intelligence, at a different cost and latency. NeuroLink is the vascular layer that carries that intelligence, as a stream, to the applications — the organs — that consume it, across three inference types: `generate` and `stream` produce text, `decide` produces a calibrated `boolean`/`choice`/`score` judgment instead. A curated model registry (64 models, 132 aliases) backs metadata, routing, and context-window checks out of the box, and hundreds more models are reachable through aggregator providers — 100+ via LiteLLM, 300+ via OpenRouter.
|
|
49
49
|
|
|
50
|
-
Extracted from production systems at Juspay, NeuroLink provides a practical, TypeScript-first way to plug any application into that nervous system. Switch which neuron answers a request with a single parameter change — OpenAI, Anthropic, Google, AWS Bedrock, Azure, a local runtime, or any provider you add. `decide` is the third inference type — a typed, calibrated judgment instead of text — for the model-routing and gating decisions `generate`/`stream` were never meant to make, powered by a purpose-built decision model (TypeSafe Jev, or the open-weights Laya or XOR) rather than a general-purpose LLM: with Jev, routing decisions land in ~400ms for about $0.00002, instead of a full generation call.
|
|
50
|
+
Extracted from production systems at Juspay, NeuroLink provides a practical, TypeScript-first way to plug any application into that nervous system. Switch which neuron answers a request with a single parameter change — OpenAI, Anthropic, Google, AWS Bedrock, Azure, a local runtime, or any provider you add. `decide` is the third inference type — a typed, calibrated judgment instead of text — for the model-routing and gating decisions `generate`/`stream` were never meant to make, powered by a purpose-built decision model (TypeSafe Jev, Perplexity's hosted Decisions API, or the open-weights Laya or XOR) rather than a general-purpose LLM: with Jev, routing decisions land in ~400ms for about $0.00002, instead of a full generation call.
|
|
51
51
|
|
|
52
52
|
**Why NeuroLink?** Three genuine inference types, not one dressed up three ways — `generate` and `stream` produce text; `decide` produces a calibrated `boolean`/`choice`/`score` judgment, and which types a provider serves is declared per-provider via `inferenceKinds` rather than inferred from behavior. Every neuron plugs into the same pipe, including 3 fully local runtimes (Ollama, LM Studio, llama.cpp) with per-request credential overrides, and MCP support covers all 4 transports (stdio, HTTP, SSE, WebSocket). Every AI-driven optimization the pipe performs — model routing, context compaction, tool selection — fails open: no key configured behaves exactly like NeuroLink without it, and routing uses asymmetric confidence thresholds (upgrade at 0.3, downgrade at 0.6) rather than a single cutoff, because a wrong downgrade costs more than a wrong upgrade. Switch providers with a single parameter change, leverage built-in tools plus any MCP-compliant tool server, deploy with confidence using enterprise features like Redis memory and multi-provider failover, and optimize costs automatically with intelligent routing. Use it via our professional CLI or TypeScript SDK—whichever fits your workflow.
|
|
53
53
|
|
|
@@ -59,41 +59,41 @@ Extracted from production systems at Juspay, NeuroLink provides a practical, Typ
|
|
|
59
59
|
|
|
60
60
|
## What's New
|
|
61
61
|
|
|
62
|
-
| Feature
|
|
63
|
-
|
|
|
64
|
-
| **`decide` Inference Type + TypeSafe Jev + Laya + XOR** | next | A third inference type alongside `generate`/`stream`: typed, calibrated judgments (`boolean`, `choice`, `score`) via `neurolink.decide()` / `tryDecide()`, one parallel pass (~400ms and ~$0.00002/decision on Jev).
|
|
65
|
-
| **7 More Catalog Providers**
|
|
66
|
-
| **Claude-on-Vertex Proxy Fallback**
|
|
67
|
-
| **Native-Loop V3 Conversation Reclaim**
|
|
68
|
-
| **Multi-Modal Embeddings**
|
|
69
|
-
| **Grok Build Auto-Configuration**
|
|
70
|
-
| **Anthropic Execution-Control Contract**
|
|
71
|
-
| **Catalog Tool Declarations Honoured at Runtime**
|
|
72
|
-
| **Artifact Stores: Redis, Custom, Range Reads, Search**
|
|
73
|
-
| **Local CLI Spend Reading**
|
|
74
|
-
| **Native OpenAI Audio Streaming**
|
|
75
|
-
| **HITL Pending-Confirmation State**
|
|
76
|
-
| **OpenCode + Gemini CLI Proxy Clients**
|
|
77
|
-
| **SambaNova Provider**
|
|
78
|
-
| **Cerebras Provider**
|
|
79
|
-
| **Avatar / Music Modalities + 12 Providers**
|
|
80
|
-
| **Multi-Provider Voice (TTS/STT)**
|
|
81
|
-
| **4 New Providers**
|
|
82
|
-
| **ModelAccessDeniedError**
|
|
83
|
-
| **Provider Fallback Policy**
|
|
84
|
-
| **Per-Request Credentials**
|
|
85
|
-
| **AutoResearch**
|
|
86
|
-
| **Gemini 3 Multi-turn Tool Fix**
|
|
87
|
-
| **MCP Enhancements**
|
|
88
|
-
| **Memory**
|
|
89
|
-
| **Context Window Management**
|
|
90
|
-
| **Tool Execution Control**
|
|
91
|
-
| **File Processor System**
|
|
92
|
-
| **RAG with generate()/stream()**
|
|
62
|
+
| Feature | Version | Description | Guide |
|
|
63
|
+
| -------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| **`decide` Inference Type + TypeSafe Jev + Laya + XOR + Perplexity** | next | A third inference type alongside `generate`/`stream`: typed, calibrated judgments (`boolean`, `choice`, `score`) via `neurolink.decide()` / `tryDecide()`, one parallel pass (~400ms and ~$0.00002/decision on Jev). Providers: TypeSafe Jev (`TYPESAFE_API_KEY`, also reachable via the Vercel AI Gateway); [Laya](docs/getting-started/providers/laya.md) (`LAYA_API_KEY` + `LAYA_BASE_URL`), an open-weights model you run yourself; [XOR](docs/getting-started/providers/xor.md) (`XOR_API_KEY` + `XOR_BASE_URL`), Juspay's open-weights model; and [Perplexity](docs/getting-started/providers/perplexity-decider.md) (`PERPLEXITY_API_KEY`, the same key as its text provider), a hosted API that also reads images — the first one configured, in that order, runs. Used internally for model routing, context budgeting, relevance compaction and tool routing — fail-open and a no-op when no decision provider is configured. Per-query RAG planning is opt-in via `RAGPipeline`. | [Decide Guide](docs/features/decide-inference-type.md) |
|
|
65
|
+
| **7 More Catalog Providers** | v12.11.0–v12.16.0 | Baseten, GMI Cloud, Inception Labs, io.net Intelligence, Mancer, Upstage and API Route onboarded as Tier-2 catalog entries — one JSON file each, roster live-verified against the provider's own `/v1/models`. | [Tier 2 Onboarding](docs/provider-integration/tiers/tier-2-catalog-entry.md) |
|
|
66
|
+
| **Claude-on-Vertex Proxy Fallback** | v12.18.0 | The Anthropic proxy pool can fall back to Claude served on Google Vertex, so an agentic turn survives losing its primary backend mid-conversation instead of failing the turn. | [Claude Proxy](docs/features/claude-proxy.md) |
|
|
67
|
+
| **Native-Loop V3 Conversation Reclaim** | v12.17.0 | Reclaims V3 conversations without splitting tool-call/tool-result pairs — the pairing a provider rejects the whole request over. | [Claude Proxy Architecture](docs/features/claude-proxy-architecture.md) |
|
|
68
|
+
| **Multi-Modal Embeddings** | v12.15.0 | `embed()` / `embedMany()` accept images alongside text on providers whose embedding models are multi-modal, for cross-modal retrieval in RAG and custom vector search. | [Embeddings Guide](docs/features/embeddings.md) |
|
|
69
|
+
| **Grok Build Auto-Configuration** | v12.14.0 | The proxy configures Grok Build automatically, deriving context windows and backends from the model catalog rather than hardcoded values. | [Proxy CLI Onboarding](docs/features/proxy-cli-onboarding.md) |
|
|
70
|
+
| **Anthropic Execution-Control Contract** | v12.13.0 | Truthful stream termination plus an opt-in execution-control contract, so a stream that stopped early reports why instead of looking like a clean finish. | [Claude Proxy](docs/features/claude-proxy.md) |
|
|
71
|
+
| **Catalog Tool Declarations Honoured at Runtime** | v12.12.0 | A Tier-2 catalog entry declaring `tools: false` (e.g. Mancer) no longer has tools offered to it at runtime — the JSON declaration is enforced, not just documented. | [Tier 2 Onboarding](docs/provider-integration/tiers/tier-2-catalog-entry.md) |
|
|
72
|
+
| **Artifact Stores: Redis, Custom, Range Reads, Search** | v12.10.0 | Artifacts can be backed by Redis or a custom store, read by byte range, and searched — instead of being held only in process memory. | [Claude Proxy](docs/features/claude-proxy.md) |
|
|
73
|
+
| **Local CLI Spend Reading** | v12.6.0–v12.9.0 | Reads token usage directly from other coding CLIs' own local stores — Cursor, Grok Build, Hermes Agent and three more — and names them in proxy traffic, so spend is attributed per client. | [Proxy CLI Onboarding](docs/features/proxy-cli-onboarding.md) |
|
|
74
|
+
| **Native OpenAI Audio Streaming** | v12.7.0 | OpenAI TTS audio streams natively rather than being buffered to completion first. | [TTS Guide](docs/features/tts.md) |
|
|
75
|
+
| **HITL Pending-Confirmation State** | v12.5.0 | Exposes whether a human-in-the-loop confirmation is still outstanding, so a caller can distinguish 'waiting on a human' from 'finished'. | [Task Manager](docs/features/task-manager.md) |
|
|
76
|
+
| **OpenCode + Gemini CLI Proxy Clients** | v12.4.0 | OpenCode's generated config is actually loadable, and Gemini CLI is onboarded as a proxy client. | [OpenCode Proxy](docs/features/opencode-proxy-support.md) \| [Proxy CLI Onboarding](docs/features/proxy-cli-onboarding.md) |
|
|
77
|
+
| **SambaNova Provider** | v12.3.0 | RDU-accelerated open-weight flagships: Llama 3.3 70B (default), GPT-OSS 120B, DeepSeek V3.x, MiniMax, Gemma 4 (vision) — OpenAI-compatible Tier 2 catalog entry. Note: new SambaNova accounts require purchased credits. | [SambaNova Guide](docs/getting-started/providers/sambanova.md) |
|
|
78
|
+
| **Cerebras Provider** | v12.1.0 | Wafer-scale inference at ~3000 tok/s: GPT-OSS 120B (default) + Gemma 4 31B, OpenAI-compatible Tier 2 catalog entry, live-verified end to end (generate, stream, tools, structured output). | [Cerebras Guide](docs/getting-started/providers/cerebras.md) |
|
|
79
|
+
| **Avatar / Music Modalities + 12 Providers** | v9.65.0 | New `output: { mode: "avatar" \| "music" }` dispatch with handlers for D-ID, HeyGen, Replicate-MuseTalk (avatar) and Beatoven, ElevenLabs Music, Lyria, Replicate-MusicGen (music). Plus Fish Audio TTS, Kling/Runway/Replicate video, xAI/Groq/Cohere/Together/Fireworks/Perplexity/Cloudflare LLMs, Voyage/Jina embeddings, Stability/Ideogram/Recraft/Replicate image-gen. | [Provider Integration](docs/provider-integration/) |
|
|
80
|
+
| **Multi-Provider Voice (TTS/STT)** | v9.62.0 | 6 TTS providers (OpenAI TTS, ElevenLabs, Google TTS, Azure TTS, Fish Audio, Cartesia) + 4 STT providers (Whisper, Deepgram, Azure STT, Google STT) + 2 realtime APIs (OpenAI Realtime, Gemini Live). | [TTS Guide](docs/features/tts.md) \| [STT Guide](docs/features/audio-input.md) \| [Realtime Guide](docs/features/real-time-services.md) |
|
|
81
|
+
| **4 New Providers** | v9.60.0 | DeepSeek (V3/R1), NVIDIA NIM (400+ catalog), LM Studio (local), llama.cpp (GGUF local). | [Provider Setup](docs/getting-started/provider-setup.md) |
|
|
82
|
+
| **ModelAccessDeniedError** | v9.59.0 | Typed `ModelAccessDeniedError` + `sdk.checkCredentials()` API for proactive credential validation before first call. | [Error Reference](docs/reference/troubleshooting.md) |
|
|
83
|
+
| **Provider Fallback Policy** | v9.58.0 | `providerFallback` callback + `modelChain` config for centralized multi-provider fallback logic. | [Advanced Guide](docs/advanced/index.md) |
|
|
84
|
+
| **Per-Request Credentials** | v9.52.0 | Pass credentials per-call or per-instance for all providers. Per-call overrides instance; instance overrides env vars. | [Credentials Guide](docs/features/per-request-credentials.md) |
|
|
85
|
+
| **AutoResearch** | v9.53.0 | Autonomous AI experiment engine: proposes code changes, runs experiments, evaluates metrics — unattended for hours. | [AutoResearch Guide](docs/features/autoresearch.md) |
|
|
86
|
+
| **Gemini 3 Multi-turn Tool Fix** | v9.49.0 | Fixed multi-step agentic tool calling on Vertex AI Gemini 3. Correct `thoughtSignature` replay, `stepIndex` grouping, `executionId` session isolation, 5-min timeout. | [Vertex AI Guide](docs/getting-started/providers/google-vertex.md) |
|
|
87
|
+
| **MCP Enhancements** | v9.16.0 | Tool routing (6 strategies), result caching (LRU/FIFO/LFU), request batching, annotations, elicitation protocol, multi-server management. | [MCP Enhancements Guide](docs/features/mcp-enhancements.md) |
|
|
88
|
+
| **Memory** | v9.12.0 | Per-user condensed memory across conversations. LLM-powered condensation with S3, Redis, or SQLite. | [Memory Guide](docs/features/memory.md) |
|
|
89
|
+
| **Context Window Management** | v9.2.0 | 5-stage compaction pipeline with budget gate at 80% usage, per-provider token estimation. | [Context Compaction Guide](docs/features/context-compaction.md) |
|
|
90
|
+
| **Tool Execution Control** | v9.3.0 | `prepareStep` and `toolChoice` for per-step tool enforcement in multi-step agentic loops. | [API Reference](docs/api/type-aliases/GenerateOptions.md#preparestep) |
|
|
91
|
+
| **File Processor System** | v9.1.0 | 17+ file type processors with ProcessorRegistry, security sanitization, SVG text injection. | [File Processors Guide](docs/features/file-processors.md) |
|
|
92
|
+
| **RAG with generate()/stream()** | v9.2.0 | Pass `rag: { files }` for automatic document chunking, embedding, and AI-powered search. 10 chunking strategies, hybrid search, reranking, and a choice of 4 vector stores (in-memory, Chroma, PgVector, Pinecone). | [RAG Guide](docs/features/rag.md) |
|
|
93
93
|
|
|
94
94
|
```typescript
|
|
95
95
|
// decide() — a third inference type: calibrated judgments, not text (next)
|
|
96
|
-
// Enable with TYPESAFE_API_KEY (or AI_GATEWAY_API_KEY via Vercel AI Gateway).
|
|
96
|
+
// Enable with a decision provider's key, e.g. TYPESAFE_API_KEY (or AI_GATEWAY_API_KEY via Vercel AI Gateway).
|
|
97
97
|
import { NeuroLink, readDecisionChoice } from "@juspay/neurolink";
|
|
98
98
|
|
|
99
99
|
const neurolink = new NeuroLink();
|
|
@@ -221,8 +221,8 @@ const neurolink = new NeuroLink({
|
|
|
221
221
|
|
|
222
222
|
## Decide: Calibrated Judgments, Not Text
|
|
223
223
|
|
|
224
|
-
**NeuroLink now supports decision models — a third inference type,
|
|
225
|
-
|
|
224
|
+
**NeuroLink now supports decision models — a third inference type, served by
|
|
225
|
+
hosted providers and by open-weights models you can run yourself.**
|
|
226
226
|
|
|
227
227
|
`decide` sits alongside `generate` and `stream`. Instead of tokens, a decision
|
|
228
228
|
model takes one `state` plus a map of named typed questions and returns one
|
|
@@ -230,8 +230,8 @@ typed, **calibrated** answer per question, all in a single parallel pass — no
|
|
|
230
230
|
text output anywhere, so nothing has to be parsed back out of prose.
|
|
231
231
|
|
|
232
232
|
Public API: `neurolink.decide()` and the fail-open `neurolink.tryDecide()`
|
|
233
|
-
(returns `null` instead of throwing).
|
|
234
|
-
|
|
233
|
+
(returns `null` instead of throwing). The CLI has a thin wrapper over `decide()`,
|
|
234
|
+
`neurolink decide [state]` — see the [CLI reference](docs/cli/commands.md#decide).
|
|
235
235
|
|
|
236
236
|
| Primitive | Answer shape | Use it for |
|
|
237
237
|
| --------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
@@ -263,15 +263,15 @@ probability, never an explanation. Those belong to `generate`.
|
|
|
263
263
|
|
|
264
264
|
### Enabling it
|
|
265
265
|
|
|
266
|
-
Set
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
Set a decision provider's key. For [TypeSafe Jev](https://console.typesafe.ai/keys)
|
|
267
|
+
(`AIProviderName.TYPESAFE`, aliases `jev` / `typesafe-ai`) that is
|
|
268
|
+
`TYPESAFE_API_KEY`, and it needs nothing else. It is also reachable through the
|
|
269
|
+
**Vercel AI Gateway** via `AI_GATEWAY_API_KEY`; force one transport with
|
|
270
|
+
`TYPESAFE_TRANSPORT=direct|gateway`. Per-request credentials work as they do for
|
|
271
|
+
every other provider.
|
|
272
272
|
|
|
273
|
-
[**Laya**](docs/getting-started/providers/laya.md) is
|
|
274
|
-
|
|
273
|
+
[**Laya**](docs/getting-started/providers/laya.md) is a decision provider —
|
|
274
|
+
Convai Innovations' Apache-2.0, open-weights "System One" model, for
|
|
275
275
|
when you'd rather run the decision model on your own infrastructure than call a
|
|
276
276
|
hosted one. There is no built-in endpoint: set `LAYA_API_KEY` and
|
|
277
277
|
`LAYA_BASE_URL` to point at a Laya server you run yourself, or a LiteLLM proxy
|
|
@@ -281,18 +281,32 @@ shorter state than TypeSafe's — about 768 tokens on the default
|
|
|
281
281
|
`typed-decisions` checkpoint (320 on `english`/`auto`), against TypeSafe's
|
|
282
282
|
~33,000 — so it fits short, structured decisions rather than long context.
|
|
283
283
|
Every built-in consumer below asks for the first configured decision provider,
|
|
284
|
-
|
|
285
|
-
Laya's key and base URL set, Laya runs.
|
|
284
|
+
in the order TypeSafe, Laya, XOR, Perplexity: with TypeSafe and Laya both
|
|
285
|
+
configured, TypeSafe runs; with only Laya's key and base URL set, Laya runs.
|
|
286
286
|
|
|
287
287
|
[**XOR**](docs/getting-started/providers/xor.md) is Juspay's Apache-2.0,
|
|
288
288
|
open-weights decision model (`xor-1.1`); setup is on
|
|
289
289
|
[Hugging Face](https://huggingface.co/juspay/xor). It has no built-in endpoint
|
|
290
290
|
either: set `XOR_API_KEY` and `XOR_BASE_URL` to the origin of a deployment or of
|
|
291
|
-
a LiteLLM proxy route (or pass `credentials.xor`).
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
a LiteLLM proxy route (or pass `credentials.xor`). XOR counts only with both its
|
|
292
|
+
key and base URL set, and a call can always name it with `provider: "xor"`. It
|
|
293
|
+
accepts images and video, which TypeSafe and Laya refuse.
|
|
294
|
+
|
|
295
|
+
[**Perplexity**](docs/getting-started/providers/perplexity-decider.md) is
|
|
296
|
+
Perplexity's hosted Decisions API (`pplx-decider-v1-27b`, provider id
|
|
297
|
+
`perplexity-decider`) and also reads images, but no video. It has a public
|
|
298
|
+
endpoint, so a key alone configures it: `PERPLEXITY_API_KEY`, or
|
|
299
|
+
`credentials.perplexityDecider`. **That key is shared with the Perplexity text
|
|
300
|
+
provider (Sonar)**, so setting it for Sonar also configures `decide`: built-in
|
|
301
|
+
features then use Perplexity whenever none of TypeSafe, Laya or XOR is
|
|
302
|
+
configured, and it never displaces one that is. Context compaction needs no other
|
|
303
|
+
opt-in, so earlier conversation text can start going to Perplexity's Decisions API
|
|
304
|
+
once a conversation outgrows its budget. To avoid that, pass the Sonar key as
|
|
305
|
+
`credentials.perplexity` instead of through the environment, and keep it out of
|
|
306
|
+
`.env` too, because the SDK and the CLI load that file into the environment, or
|
|
307
|
+
configure one of TypeSafe, Laya and XOR; the guide lists
|
|
308
|
+
[what each consumer sends](docs/getting-started/providers/perplexity-decider.md#what-is-sent-to-perplexity)
|
|
309
|
+
and [the exact switches](docs/getting-started/providers/perplexity-decider.md#one-key-two-providers).
|
|
296
310
|
|
|
297
311
|
```typescript
|
|
298
312
|
import {
|
|
@@ -333,7 +347,7 @@ else queueForHuman();
|
|
|
333
347
|
### Where NeuroLink uses it itself
|
|
334
348
|
|
|
335
349
|
**Five `decide()` calls across the codebase**, each fail-open and a no-op
|
|
336
|
-
|
|
350
|
+
while no decision provider is configured — so nothing changes in its absence:
|
|
337
351
|
|
|
338
352
|
| # | Call site | What it asks | Guide |
|
|
339
353
|
| --- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
@@ -367,14 +381,23 @@ apart.
|
|
|
367
381
|
|
|
368
382
|
### What it costs, and its limits
|
|
369
383
|
|
|
370
|
-
Measured against
|
|
384
|
+
Measured against TypeSafe's live API — don't extrapolate past these:
|
|
371
385
|
|
|
372
386
|
- Latency is flat in question count: 1 question ~393ms, 400 questions ~465ms. Concurrent requests **queue**, so batch every question into one call — never fan out.
|
|
373
387
|
- ~$0.042 per million input tokens, output reported but billed at zero — about **$0.00002 per decision**.
|
|
374
388
|
- Two input ceilings: `state` + the longest single question ≈ 33,000 tokens; `state` + all questions ≈ 64,000 tokens.
|
|
375
389
|
- **Accuracy is the trade-off**: ~68% on TypeSafe's own 711-case benchmark vs. ~73% for a frontier model (TypeSafe's published figures, not our measurement). Use it for decisions that are **gated and reversible** — routing, dropping, budgeting — never for a final answer a user will see.
|
|
376
390
|
|
|
377
|
-
|
|
391
|
+
The figures above are TypeSafe's. Perplexity's Decisions API, measured on a real account in October 2026:
|
|
392
|
+
|
|
393
|
+
- Up to 128 questions and 8 images per request. The server reads under 262,144 input tokens (the state and the questions count; images are billed as input tokens and assumed to count too, which was not measured) and refuses more with an explicit 400; it never cuts a state off silently.
|
|
394
|
+
- Latency grows faster than linearly with input: 3.9 s at 65,000 tokens, 10 s at 146,000, 22.9 s at 251,000 (about 17,000, 15,000 and 11,000 tokens per second). An image costs about one input token per 32 × 32 tile plus about 95 per image, a fit to three measured sizes.
|
|
395
|
+
- 10 requests per second on the account tested; a 429 carries `Retry-After`, which NeuroLink honours.
|
|
396
|
+
- NeuroLink's own state window is 100,000 estimated tokens, a deliberate local limit and not the server's. The price, $0.04 per million input tokens (image tokens included, output free), is Perplexity's documented figure.
|
|
397
|
+
|
|
398
|
+
The [guide's limits section](docs/getting-started/providers/perplexity-decider.md#limits) has the full table, including tokens per character and the image-size rule.
|
|
399
|
+
|
|
400
|
+
**[Decide Guide](docs/features/decide-inference-type.md)** · **[TypeSafe Provider Guide](docs/getting-started/providers/typesafe.md)** · **[Laya Provider Guide](docs/getting-started/providers/laya.md)** · **[XOR Provider Guide](docs/getting-started/providers/xor.md)** · **[Perplexity Provider Guide](docs/getting-started/providers/perplexity-decider.md)**
|
|
378
401
|
|
|
379
402
|
## Enterprise Security: Human-in-the-Loop (HITL)
|
|
380
403
|
|
|
@@ -653,7 +676,7 @@ NeuroLink is a comprehensive AI development platform. Every feature below is shi
|
|
|
653
676
|
|
|
654
677
|
### 🤖 AI Provider Integration
|
|
655
678
|
|
|
656
|
-
**Provider neurons behind one API** - Switch providers with a single parameter change. Nearly all serve `generate`/`stream`; TypeSafe Jev, Laya and
|
|
679
|
+
**Provider neurons behind one API** - Switch providers with a single parameter change. Nearly all serve `generate`/`stream`; TypeSafe Jev, Laya, XOR and Perplexity Decisions serve `decide` instead. Tool support: 31 native tool-calling, 3 model-dependent, the rest serve no tools at all (embedding-, media- and decision-only). 3 are fully local runtimes (Ollama, LM Studio, llama.cpp) and 4 need zero configuration to start (those three plus LiteLLM) — no cloud account, no API key. 9 providers (OpenAI, Google AI Studio, Google Vertex, Amazon Bedrock, Cohere, Ollama, LiteLLM, Voyage, Jina) expose `embed()`/`embedMany()` natively for RAG and custom vector search.
|
|
657
680
|
|
|
658
681
|
| Provider | Models | Free Tier | Tool Support | Status | Documentation |
|
|
659
682
|
| --------------------- | -------------------------------------------------------------------------- | --------------- | ------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -687,9 +710,9 @@ NeuroLink is a comprehensive AI development platform. Every feature below is shi
|
|
|
687
710
|
|
|
688
711
|
**Media generation** — [Replicate](docs/getting-started/providers/replicate.md) (`REPLICATE_API_TOKEN`) · [Stability AI](docs/getting-started/providers/stability.md) (`STABILITY_API_KEY`) · [Ideogram](docs/getting-started/providers/ideogram.md) (`IDEOGRAM_API_KEY`) · [Recraft](docs/getting-started/providers/recraft.md) (`RECRAFT_API_KEY`)
|
|
689
712
|
|
|
690
|
-
**Decision** — [TypeSafe Jev](docs/getting-started/providers/typesafe.md) (`TYPESAFE_API_KEY`, or `AI_GATEWAY_API_KEY` via the Vercel AI Gateway) · [Laya](docs/getting-started/providers/laya.md) (`LAYA_API_KEY` + `LAYA_BASE_URL`, open-weights, self-hosted) · [XOR](docs/getting-started/providers/xor.md) (`XOR_API_KEY` + `XOR_BASE_URL`, open-weights) — the providers serving `decide` rather than `generate`/`stream`.
|
|
713
|
+
**Decision** — [TypeSafe Jev](docs/getting-started/providers/typesafe.md) (`TYPESAFE_API_KEY`, or `AI_GATEWAY_API_KEY` via the Vercel AI Gateway) · [Laya](docs/getting-started/providers/laya.md) (`LAYA_API_KEY` + `LAYA_BASE_URL`, open-weights, self-hosted) · [XOR](docs/getting-started/providers/xor.md) (`XOR_API_KEY` + `XOR_BASE_URL`, open-weights) · [Perplexity Decisions](docs/getting-started/providers/perplexity-decider.md) (`PERPLEXITY_API_KEY`, hosted; the same key as the Perplexity text provider) — the providers serving `decide` rather than `generate`/`stream`.
|
|
691
714
|
|
|
692
|
-
**Decision-only providers:** **TypeSafe Jev** (`TYPESAFE_API_KEY`), **Laya** (`LAYA_API_KEY` + `LAYA_BASE_URL`)
|
|
715
|
+
**Decision-only providers:** **TypeSafe Jev** (`TYPESAFE_API_KEY`), **Laya** (`LAYA_API_KEY` + `LAYA_BASE_URL`), **XOR** (`XOR_API_KEY` + `XOR_BASE_URL`) and **Perplexity Decisions** (`PERPLEXITY_API_KEY`) do not appear in the table above because none of them serves `generate`/`stream` — they are the providers for the `decide` inference type, tried in the order TypeSafe, Laya, XOR, Perplexity when several are configured. Perplexity's key is shared with the Perplexity text provider, which does appear in the table. See [Decide: Calibrated Judgments, Not Text](#decide-calibrated-judgments-not-text).
|
|
693
716
|
|
|
694
717
|
**[📖 Provider Comparison Guide](docs/reference/provider-comparison.md)** - Detailed feature matrix and selection criteria
|
|
695
718
|
**[🔬 Provider Feature Compatibility](docs/reference/provider-feature-compatibility.md)** - Test-based compatibility reference for 19 features (dated snapshot covering a subset of the full provider list)
|
|
@@ -1211,18 +1234,18 @@ Full command and API breakdown lives in [`docs/cli/commands.md`](docs/cli/comman
|
|
|
1211
1234
|
|
|
1212
1235
|
## Platform Capabilities at a Glance
|
|
1213
1236
|
|
|
1214
|
-
| Capability | Highlights
|
|
1215
|
-
| ------------------------ |
|
|
1216
|
-
| **Provider unification** | Provider neurons behind one API, with automatic fallback, cost-aware routing, `providerFallback` policy, `modelChain` config.
|
|
1217
|
-
| **Decision inference** | Third inference type (`decide`) alongside generate/stream: calibrated `boolean`/`choice`/`score` judgments via TypeSafe Jev (~400ms flat, ~$0.00002/decision), Laya, a self-hosted open-weights alternative,
|
|
1218
|
-
| **Multimodal pipeline** | Stream images + CSV data + PDF documents across providers with local/remote assets. Auto-detection for mixed file types.
|
|
1219
|
-
| **Voice pipeline** | TTS (6 providers: Google, OpenAI, ElevenLabs, Azure, Fish Audio, Cartesia) + STT (4 providers) + realtime voice APIs (OpenAI Realtime, Gemini Live).
|
|
1220
|
-
| **Quality & governance** | Auto-evaluation engine (14 scorers), guardrails middleware, HITL workflows, audit logging.
|
|
1221
|
-
| **Memory & context** | Per-user condensed memory (S3/Redis/SQLite), Redis session export, 5-stage context compaction.
|
|
1222
|
-
| **CLI tooling** | 34 commands: loop sessions, setup wizard, config validation, Redis auto-detect, JSON output, TTS/STT flags.
|
|
1223
|
-
| **Enterprise ops** | Claude proxy, OTLP observability, OpenObserve dashboard, regional routing, credential management.
|
|
1224
|
-
| **Tool ecosystem** | MCP auto discovery, HTTP/stdio/SSE/WebSocket transports, LiteLLM hub access, SageMaker custom deployment, web search.
|
|
1225
|
-
| **Engineering rigor** | 129 end-to-end test suites (every suite drives the public `generate`/`stream`/`decide`/CLI surface, never internals), 13 custom ESLint rules enforcing the architecture (no `interface`, unique type names, barrel-only type imports) — all AST-based, no regex heuristics.
|
|
1237
|
+
| Capability | Highlights |
|
|
1238
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1239
|
+
| **Provider unification** | Provider neurons behind one API, with automatic fallback, cost-aware routing, `providerFallback` policy, `modelChain` config. |
|
|
1240
|
+
| **Decision inference** | Third inference type (`decide`) alongside generate/stream: calibrated `boolean`/`choice`/`score` judgments via TypeSafe Jev (~400ms flat, ~$0.00002/decision), Laya, a self-hosted open-weights alternative, XOR, Juspay's open-weights model, or Perplexity's hosted Decisions API. Used internally for model routing, context budgeting, relevance compaction and tool routing; per-query RAG planning is opt-in via `RAGPipeline`. |
|
|
1241
|
+
| **Multimodal pipeline** | Stream images + CSV data + PDF documents across providers with local/remote assets. Auto-detection for mixed file types. |
|
|
1242
|
+
| **Voice pipeline** | TTS (6 providers: Google, OpenAI, ElevenLabs, Azure, Fish Audio, Cartesia) + STT (4 providers) + realtime voice APIs (OpenAI Realtime, Gemini Live). |
|
|
1243
|
+
| **Quality & governance** | Auto-evaluation engine (14 scorers), guardrails middleware, HITL workflows, audit logging. |
|
|
1244
|
+
| **Memory & context** | Per-user condensed memory (S3/Redis/SQLite), Redis session export, 5-stage context compaction. |
|
|
1245
|
+
| **CLI tooling** | 34 commands: loop sessions, setup wizard, config validation, Redis auto-detect, JSON output, TTS/STT flags. |
|
|
1246
|
+
| **Enterprise ops** | Claude proxy, OTLP observability, OpenObserve dashboard, regional routing, credential management. |
|
|
1247
|
+
| **Tool ecosystem** | MCP auto discovery, HTTP/stdio/SSE/WebSocket transports, LiteLLM hub access, SageMaker custom deployment, web search. |
|
|
1248
|
+
| **Engineering rigor** | 129 end-to-end test suites (every suite drives the public `generate`/`stream`/`decide`/CLI surface, never internals), 13 custom ESLint rules enforcing the architecture (no `interface`, unique type names, barrel-only type imports) — all AST-based, no regex heuristics. |
|
|
1226
1249
|
|
|
1227
1250
|
## Documentation Map
|
|
1228
1251
|
|
|
@@ -1250,7 +1273,7 @@ Full command and API breakdown lives in [`docs/cli/commands.md`](docs/cli/comman
|
|
|
1250
1273
|
|
|
1251
1274
|
**Decision Inference:**
|
|
1252
1275
|
|
|
1253
|
-
- [Decide Guide](docs/features/decide-inference-type.md) - The `decide` inference type: boolean/choice/score primitives, TypeSafe Jev / Laya / XOR setup, measured latency/cost
|
|
1276
|
+
- [Decide Guide](docs/features/decide-inference-type.md) - The `decide` inference type: boolean/choice/score primitives, TypeSafe Jev / Laya / XOR / Perplexity setup, measured latency/cost
|
|
1254
1277
|
|
|
1255
1278
|
**Provider Intelligence:**
|
|
1256
1279
|
|