Installation
Install DeepHull via npm or pip:
npm install @deephull/core
# Python
pip install deephull
Quick Start
Wrap your AI pipeline with DeepHull's protection layer:
import { DeepHull } from '@deephull/core';
const hull = new DeepHull({
isolation: true,
autoRecovery: true,
circuitBreaker: true
});
await hull.protect(async () => {
// Your AI pipeline code
const result = await llm.generate(prompt);
return result;
});
CLI Tools
Hull Check
Scan your codebase for single points of failure:
# Output:
[SCAN] Analyzing 47 files...
[WARNING] api/llm.ts:23 - Unprotected API call detected
[WARNING] parser/json.ts:45 - No error handling for malformed JSON
[INFO] Critical Breach Detected. Initializing Auto-Repair...
hull-guard
Real-time monitoring and cost protection for your AI applications.
Features
• Automatic traffic anomaly detection
• Cost threshold alerts and throttling
• Response time monitoring
• Token consumption tracking
Usage
const guard = new HullGuard({
maxCostPerHour: 100,
maxTokensPerRequest: 4000,
alertWebhook: 'https://your-webhook.com'
});
guard.monitor(yourLLMCall);
self-heal-parser
Automatically repairs broken or malformed LLM outputs.
Capabilities
• JSON schema validation and repair
• Code syntax correction
• Encoding error recovery
• Incomplete response completion
Usage
const parser = new SelfHealParser();
const result = await parser.parse(llmOutput, schema);
nexus-fallback
Dynamic routing between multiple LLM providers based on health metrics.
Supported Providers
• OpenAI (GPT-4, GPT-3.5)
• Anthropic (Claude)
• Google (Gemini)
• Local models (Llama, Mistral)
Usage
const nexus = new NexusFallback({
providers: ['openai', 'anthropic', 'local-llama'],
healthCheckInterval: 30000
});
const response = await nexus.generate(prompt);
state-rewind
Automatic state snapshots with millisecond-level rollback capability.
Features
• Automatic state capture every 100ms
• Instant rollback on failure
• Memory-efficient snapshot storage
• Transaction-like guarantees
Usage
const rewind = new StateRewind();
await rewind.transaction(async (snapshot) => {
// Your stateful operations
await step1();
await step2();
// Auto-rollback on any failure
});