Skip to content

Architecture

This content is for v0.9.2. Switch to the latest version for up-to-date documentation.

nxusKit is organized around a shared provider model with language-specific wrappers for Rust, Go, Python, and C. Each wrapper exposes native types while keeping the same core concepts: provider configuration, chat requests, chat responses, streaming chunks, and structured error handling.

The architecture has four practical layers:

  1. Language wrappers — Idiomatic SDK surfaces for application code.
  2. Provider abstraction — A common contract for chat, streaming, capability discovery, and provider metadata.
  3. Provider implementations — Cloud LLMs, local LLMs, CLIPS, Z3, Mock, Loopback, and MCP adapters.
  4. Native boundary — C ABI functions and ownership rules for embedding and cross-language integration.
ComponentRole
Rust SDKReference implementation, async provider interface, CLI, and native engine integrations.
Go SDKGo-native provider interface with context cancellation and channel-based streaming.
Python SDKPython-friendly provider creation, chat calls, and FFI access.
C ABIStable native boundary for providers, responses, streams, errors, and CLIPS sessions.
CLIShell interface for chat, provider checks, structured JSON workflows, and Pro features.
ExamplesRunnable patterns and applications that demonstrate cross-language usage.

nxusKit providers fall into four broad groups:

FamilyExamplesBehavior
Cloud LLMsOpenAI, Anthropic, Groq, Mistral, Fireworks, Together, OpenRouter, PerplexityHosted model APIs with provider-specific capabilities.
Local LLMsOllama, LM Studio, in-process GGUF backendsLocal inference for development, privacy, or low-latency use cases.
Deterministic enginesCLIPS, Z3Repeatable rule evaluation, inference, constraint solving, and optimization.
Utility providersMock, Loopback, MCPTesting, integration checks, and tool-oriented workflows.

See the Provider Model for the shared configuration and request flow.

The SDK keeps concepts aligned across languages:

ConceptRustGoC ABI
Provider configurationProviderConfigProviderConfigprovider config JSON
Chat requestChatRequestChatRequestrequest JSON
Chat responseChatResponseChatResponseresponse handle + JSON
Streamingasync streamchannel streamcallback stream
Errorstyped errorstyped errorsnxuskit_last_error()

This lets teams choose a language per service without redesigning provider selection, request structure, credentials, or feature-gating behavior.

The C ABI is the stable integration point for native consumers and higher-level FFI wrappers. It uses opaque handles for providers, responses, and streams. Any memory returned across the boundary has a matching free function.

Read the C ABI Reference before embedding nxusKit in C, C++, Go FFI, Python FFI, or another native runtime.

Application code
-> language wrapper or C ABI
-> provider configuration
-> chat or streaming request
-> provider implementation
-> response, chunks, metadata, or typed error

For Pro features, the same call path also checks license state before executing the feature. Community-tier features continue to run without a license token.