N
NobleLexDocs
DocumentationConfiguration
Dual-Engine Topology

Model Providers & LLM Configuration

Open Legal Chat

Detailed architecture of NobleLex's dual-engine reasoning setup pairing NVIDIA NIM with Groq LPU inference.

3 min readNobleLex Official
High-Reasoning & Real-Timearchitecture/v2

Dual-Engine Legal Inference Pipeline

NobleLex is optimized for reasoning-heavy legal models that support schema-validated function calling and thought output. We deploy a decoupled dual-engine topology: an extended-thinking model for heavy statutory synthesis and a sub-200ms engine for conversational and in-browser tool assistance.

Primary Model

Moonshot Kimi K3

NVIDIA NIM
Provider Endpointintegrate.api.nvidia.com/v1
Model Identifiermoonshotai/kimi-k3

Key Capabilities

  • Extended Thinking Tokens: Exposes explicit reasoning_content blocks for judicial rationale audit.
  • OpenAI-Compatible Tool Calling: Seamless integration with Indian Kanoon, citation search, and document retrieval agents.
  • Statutory Fidelity: Uncompromising precision across IPC/BNS, CrPC/BNSS, and constitutional law commentaries.
nim-client.ts
// Primary Model: Moonshot Kimi K3 via NVIDIA NIM
import OpenAI from "openai";

export const nimClient = new OpenAI({
  apiKey: process.env.NVIDIA_NIM_API_KEY,
  baseURL: "https://integrate.api.nvidia.com/v1",
});

export const PRIMARY_LEGAL_MODEL = "moonshotai/kimi-k3";

// Handles extended reasoning_content tokens and strict tool calling
export async function streamLegalReasoning(messages: any[], tools?: any[]) {
  return await nimClient.chat.completions.create({
    model: PRIMARY_LEGAL_MODEL,
    messages,
    tools,
    stream: true,
    temperature: 0.2,
    max_tokens: 4096,
  });
}
MiniBot Engine

Qwen 3.6 27B

Groq LPU
Provider Endpointapi.groq.com/openai/v1
Model Identifierqwen/qwen3.6-27b

Key Capabilities

  • Sub-200ms Latency: Instantaneous token generation powered by Groq Language Processing Units (LPUs).
  • Native JSON Tool Calling: Rapid execution of structured functions such as read_page and DOM parsing.
  • Lightweight Copilot: Powers interactive conversational nudges without depleting high-reasoning trial token quotas.
groq-minibot.ts
// MiniBot Model: Qwen 3.6 27B via Groq SDK
import Groq from "groq-sdk";

export const groqClient = new Groq({
  apiKey: process.env.GROQ_API_KEY,
});

export const MINIBOT_MODEL = "qwen/qwen3.6-27b";

// Ultra-low latency tool caller (<200ms TTFT)
export async function runMiniBotAction(messages: any[]) {
  return await groqClient.chat.completions.create({
    model: MINIBOT_MODEL,
    messages,
    temperature: 0.1,
    max_tokens: 1024,
    response_format: { type: "json_object" }
  });
}

Technical Specification Matrix

SpecificationMoonshot Kimi K3Qwen 3.6 27B
Primary RoleComplex statutory analysis, drafting & courtroom debateMiniBot sidecar, interactive queries & fast page actions
Inference HostNVIDIA NIM API InfrastructureGroq LPU Acceleration Cluster
Reasoning Formatreasoning_content (CoT)Fast Token Stream / JSON
Tool ExecutionOpenAI standard function schemasNative JSON output schemas (read_page)
Latency ProfileDeep deliberation (3–10s)<200ms time-to-first-token

Environment Configuration

Add these required credentials to your .env.local file.

# NVIDIA NIM Configuration (Primary Reasoning)
NVIDIA_NIM_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
NVIDIA_BASE_URL="https://integrate.api.nvidia.com/v1"
PRIMARY_MODEL="moonshotai/kimi-k3"

# Groq Configuration (MiniBot & In-Browser Tools)
GROQ_API_KEY="gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MINIBOT_MODEL="qwen/qwen3.6-27b"