One orchestrator, replaceable model providers
NietzX treats the model as a planner and language interface. The desktop host owns credentials, permissions, tool execution, validation, and the persistent task record. Changing providers does not grant a model direct operating-system access.
A task and any files, pages, or constraints supplied by the user.
Builds context, selects a provider, and owns the task state.
Normalizes REST, streaming, messages, and tool-call formats.
Checks scope, approval requirements, and tool arguments.
Reads, writes, browses, or accesses memory within the allowed scope.
API-provider access and MCP-tool access are independent. A valid model API key does not automatically authorize filesystem, browser, memory, or external-write tools.
Request lifecycle
Every autonomous task is a bounded loop. NietzX can continue across multiple model and tool turns, but the host—not the model—decides what is executable and when the task is complete.
-
Normalize the task
Capture the goal, active workspace, device policy, selected provider, and allowed tool classes.
-
Assemble context
Load only relevant conversation state, permitted resources, and persistent-memory matches.
-
Call the provider
Translate the neutral request into the provider’s required headers, body, and tool schema.
-
Validate a tool request
Check the tool name, JSON Schema arguments, path or URL scope, and whether user approval is required.
-
Execute through MCP
Send the approved request to the corresponding local or remote MCP server and capture structured output.
-
Return evidence
Feed the bounded result back to the provider, continue if necessary, then verify and report the outcome.
Third-party provider APIs
Each provider has its own authentication and payload format. NietzX presents one internal interface and translates it at the network edge. Keys remain in the operating system’s credential store and are never inserted into prompts, tool arguments, analytics, or support messages.
| Provider | Primary REST endpoint | Authentication | NietzX adapter |
|---|---|---|---|
| Anthropic | POST https://api.anthropic.com/v1/messages |
x-api-key + anthropic-version |
Messages content blocks and tool-use blocks |
| OpenAI | POST https://api.openai.com/v1/responses |
Authorization: Bearer … |
Responses input/output items and function tools |
| DeepSeek | POST https://api.deepseek.com/chat/completions |
Authorization: Bearer … |
OpenAI-compatible messages and function calls |
| Gemini | POST …/v1beta/models/{model}:generateContent |
x-goog-api-key |
Content parts, function declarations, and function responses |
| Ollama | POST http://localhost:11434/api/chat |
Local endpoint; do not expose it publicly | Local chat messages and tool calls |
Anthropic
Messages API
The direct Claude API requires an API key, an API-version header, and a JSON message body. Tool definitions are sent with the request; a tool-use content block is validated and dispatched through the NietzX permission layer.
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
--data-binary @- <<JSON
{
"model": "$NIETZX_ANTHROPIC_MODEL",
"max_tokens": 1024,
"messages": [{"role":"user","content":"Summarize this task."}]
}
JSON
OpenAI
Responses API
The Responses API is the preferred agentic interface for current OpenAI models. NietzX converts neutral messages and tools into response input items, then maps function-call output back into the common tool loop.
curl https://api.openai.com/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON
{
"model": "$NIETZX_OPENAI_MODEL",
"input": "Summarize this task."
}
JSON
DeepSeek
Chat Completions compatible
DeepSeek accepts an OpenAI-compatible Chat Completions shape at its own base URL. Model aliases are provider-controlled; keep them in signed application configuration rather than hard-coding them into orchestration logic.
curl https://api.deepseek.com/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<JSON
{
"model": "$NIETZX_DEEPSEEK_MODEL",
"messages": [{"role":"user","content":"Summarize this task."}],
"stream": false
}
JSON
Gemini
Generate Content adapter
Gemini REST requests represent conversation content as parts. The adapter maps NietzX’s neutral text and tool contracts into Google function declarations and returns function responses as content parts.
curl "https://generativelanguage.googleapis.com/v1beta/models/${NIETZX_GEMINI_MODEL}:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{"contents":[{"parts":[{"text":"Summarize this task."}]}]}'
Displayed product names and callable API model IDs are not always identical. NietzX should resolve a configured provider model ID at runtime and surface unsupported or retired models as configuration errors.
Provider-neutral adapter contract
The orchestrator should never branch throughout the application on a provider name. One adapter boundary contains authentication, request translation, streaming events, usage accounting, and provider errors.
type ProviderRequest = {
model: string;
messages: NeutralMessage[];
tools: NeutralTool[];
signal?: AbortSignal;
};
type ProviderEvent =
| { type: "text_delta"; text: string }
| { type: "tool_call"; id: string; name: string; arguments: unknown }
| { type: "usage"; inputTokens: number; outputTokens: number }
| { type: "complete"; stopReason: string };
interface ProviderAdapter {
stream(request: ProviderRequest): AsyncIterable<ProviderEvent>;
validateModel(model: string): Promise<void>;
}
Adapter responsibilities
- Read a key reference from the secure credential service; never accept a raw key from a prompt.
- Apply the provider’s base URL, headers, API version, timeouts, and request identifier.
- Normalize streaming deltas, tool calls, usage, stop reasons, and retryable errors.
- Preserve the provider request ID in diagnostic logs without recording prompt secrets.
- Return a typed failure when a model ID, parameter, or tool feature is unsupported.
MCP architecture inside NietzX
Model Context Protocol is a JSON-RPC-based standard for connecting an AI host to tools, resources, and prompt templates. NietzX is the host; it creates an MCP client connection for each approved server.
Owns user consent, model access, lifecycle, and the final task result.
Scoped files, directories, and edits.
Visible page state and bounded interaction.
User-controlled durable context and retrieval.
Tools
Executable operations described by a name, purpose, and JSON Schema input. NietzX validates every call before execution.
Resources
Addressable context such as files, records, or generated state that a host can list and read without treating it as an action.
Prompts
Reusable interaction templates exposed by a server and selected explicitly through the host’s user experience.
Transport selection
stdio is appropriate for local child-process servers: messages travel through standard input and output without opening a network port. Streamable HTTP is appropriate for remote servers: clients send JSON-RPC messages with HTTP POST, with optional Server-Sent Events for streaming.
At initialization, the client and server negotiate a protocol version and capabilities. NietzX should terminate the connection when no compatible protocol version can be negotiated.
{
"name": "filesystem.read_text",
"description": "Read UTF-8 text from an allowed workspace file.",
"inputSchema": {
"type": "object",
"properties": {
"path": { "type": "string", "description": "Workspace-relative path" }
},
"required": ["path"],
"additionalProperties": false
}
}
NietzX MCP tool surface
These logical capability names document the public behavior expected from a NietzX build. Exact server and tool identifiers may vary by release, but the permission boundary must remain equivalent.
filesystem.readReads an explicitly scoped file or directory. Read-only and bounded to an approved root.
filesystem.writeCreates or edits a named file. The host previews or records changes and blocks paths outside the workspace.
browser.snapshotReturns the current visible or semantic page state without reading browser credentials or unrelated profile data.
browser.navigateLoads a permitted URL. External side effects remain subject to policy and user approval.
browser.interactClicks or types against a uniquely resolved element after the host confirms the page state is current.
memory.searchRetrieves the smallest relevant set of user-approved persistent-memory records.
memory.storeWrites a durable memory only when the content and retention policy permit persistence.
task.reportRecords structured progress, verification evidence, failures, and the final outcome for the active task.
Security boundaries
Autonomy is useful only when authority is explicit. NietzX separates model selection, credential access, tool discovery, and tool execution so a compromised prompt cannot silently widen its permissions.
- Credential isolation
Store provider secrets with Windows DPAPI or Apple Keychain. Resolve them only inside the provider adapter.
- Least-privilege tools
Expose only the servers and tool classes required for the active task; start with read-only access.
- Argument validation
Validate every tool payload against JSON Schema, canonicalize paths and URLs, and reject additional properties.
- Approval gates
Require confirmation for destructive changes, external publication, purchases, messages, and new authority.
- Prompt-injection resistance
Treat web pages and files as untrusted data. Their instructions cannot override host policy or user intent.
- Bounded logs
Keep request IDs, timing, tool names, and errors; redact keys, private content, recovery phrases, and raw credentials.
- Remote MCP security
Use TLS, authenticate the remote server, scope tokens, validate Origin where applicable, and do not expose local servers publicly.
- Result verification
Check file existence, page state, response status, or other direct evidence before reporting that an action succeeded.
Llama 3.1 8B through Ollama
Local inference keeps prompts and model execution on the user’s device and removes per-token cloud-provider billing. The trade-off is local storage, memory pressure, and lower generation speed on CPU-only systems.
ollama run llama3.1:8b
curl http://localhost:11434/api/chat \
-d '{
"model": "llama3.1:8b",
"messages": [{"role":"user","content":"Describe the active task."}],
"stream": false
}'
NietzX deployment guidance
Ollama publishes model size and supported hardware, but it does not publish one universal minimum-RAM number for this model. The following figures are operational guidance, not vendor guarantees; memory use grows with context length and concurrent workloads.
| Profile | Memory guidance | Expected use | Notes |
|---|---|---|---|
| Tight minimum | 8 GB system or unified memory | Short prompts, small context, one task | May fall back to CPU and compete heavily with the operating system. |
| Recommended | 16 GB system or unified memory | Normal desktop-agent use | Leaves practical headroom for the app, browser, model runtime, and context cache. |
| GPU acceleration | Approximately 8 GB usable VRAM | Faster quantized 8B inference | Supported Nvidia, AMD, Apple Metal, or Vulkan hardware depends on the Ollama platform matrix. |
| Longer context | 32 GB+ system or unified memory | Large documents or multitasking | A 128K model capability does not mean every device can hold a 128K runtime context efficiently. |
Ollama’s default local API is suitable for loopback access. Do not bind it to an untrusted network interface without adding authentication, transport security, and network policy.
Errors, retries, and observability
A provider response or MCP result is evidence, not an unconditional success signal. The runtime preserves enough structured information to retry safely, diagnose failures, and avoid duplicate side effects.
| Condition | NietzX behavior | Do not |
|---|---|---|
| 429 or transient 5xx | Respect retry headers, use capped exponential backoff with jitter, and preserve cancellation. | Retry indefinitely or duplicate a completed external action. |
| Invalid model or parameter | Fail configuration clearly and direct the user to the provider catalog. | Silently switch to an unapproved model. |
| Malformed tool arguments | Reject before execution and return a structured validation error to the model. | Repair dangerous paths or URLs by guessing. |
| MCP connection lost | Mark the tool result unknown, reconnect only when safe, and re-read state before another write. | Assume the previous action failed or succeeded without verification. |
| User cancellation | Abort the provider stream and cancellable tool work; retain a concise task record. | Start another model turn after cancellation. |
Official sources
The protocol, endpoints, authentication headers, model artifacts, and hardware-support statements above were checked against primary documentation. Provider model availability should still be resolved at runtime.