-
-
Notifications
You must be signed in to change notification settings - Fork 47
Home
An AI-native operating system with built-in reasoning capabilities
Cortex Linux is a purpose-built operating system that integrates AI reasoning directly into the kernel and system services. Unlike traditional Linux distributions that require external API calls for AI functionality, Cortex provides on-device reasoning with zero API costs and minimal resource overhead.
- Minimum: 2GB RAM, 10GB disk space, x86_64 or ARM64 architecture
- Recommended: 4GB+ RAM, 20GB+ disk space
- Supported Platforms: VirtualBox, VMware, bare metal, AWS, DigitalOcean, Google Cloud
# Download latest ISO
wget https://releases.cortexlinux.org/cortex-linux-latest.iso
# For VirtualBox users
# See: Installation-Guide.md#virtualbox
# For bare metal
# See: Installation-Guide.md#bare-metal
# For cloud deployment
# See: Installation-Guide.md#cloud-deploymentFull installation instructions: Installation Guide
| Metric | Value |
|---|---|
| Sudoku Solve Rate | 55% (on-device, no API calls) |
| API Costs | $0 (fully on-device) |
| Memory Footprint | 200MB (Sapiens 0.27B engine) |
| Reasoning Latency | 50-200ms (typical) |
| Supported Architectures | x86_64, ARM64 |
| Kernel Version | Linux 6.1+ (Cortex-enhanced) |
Cortex Linux combines a hardened Linux kernel with the Sapiens 0.27B reasoning engine, providing AI capabilities that are:
- On-device: All reasoning happens locally, ensuring data privacy
- Zero-cost: No API calls, no subscription fees
- Low-latency: Sub-200ms response times for most operations
- Resource-efficient: Runs on modest hardware configurations
- Kernel Layer: Enhanced Linux kernel with AI-aware scheduling and resource management
- AI Layer: Sapiens 0.27B reasoning engine integrated into system services
- Service Layer: Systemd services providing AI capabilities via CLI and HTTP API
- Application Layer: Standard Linux userland with AI-enhanced tools
Detailed architecture: Technical Specifications
The Sapiens 0.27B model is integrated directly into the operating system, accessible via:
-
CLI Tools:
cortex-aicommand-line interface - HTTP API: RESTful endpoints for programmatic access
- System Services: Background services for automated reasoning tasks
Documentation: AI Integration Guide
Unlike cloud-based AI services, Cortex requires no external API calls. All reasoning happens on-device, eliminating:
- Per-request API fees
- Data transmission costs
- Vendor lock-in
- Privacy concerns from data exfiltration
- All data remains on-device
- No telemetry or external communication
- Configurable network isolation
- Compliance-ready for GDPR, HIPAA, SOC2
Security details: Security and Compliance
# Command-line usage
cortex-ai reason "Analyze this error log and suggest fixes"
# HTTP API
curl -X POST http://localhost:8080/reason \
-H "Content-Type: application/json" \
-d '{"query": "Optimize this database query"}'
# Python integration
from cortex import AI
ai = AI()
result = ai.reason("Debug this code snippet")Examples: Use Cases and Tutorials
- 55% Sudoku solve rate (competitive with larger models)
- Sub-200ms latency for typical reasoning tasks
- 200MB memory footprint
- Efficient CPU utilization
Benchmarks: Technical Specifications
Cortex can analyze error logs, stack traces, and system diagnostics to provide actionable debugging suggestions.
cortex-ai debug /var/log/app/error.logAutomated analysis of infrastructure configurations, performance metrics, and deployment strategies.
cortex-ai optimize --target infrastructure --config /etc/ansible/hostsReasoning engine assists in system design decisions, technology selection, and architectural trade-offs.
cortex-ai plan --requirements requirements.md --output architecture.mdComplete tutorials: Use Cases and Tutorials
| Feature | Cortex Linux | Ubuntu + ChatGPT API | Cloud AI Services |
|---|---|---|---|
| API Costs | $0 | $0.002-$0.06 per request | $0.01-$0.10 per request |
| Privacy | 100% on-device | Data sent to OpenAI | Data sent to vendor |
| Latency | 50-200ms | 500-2000ms | 200-1000ms |
| Offline Capable | Yes | No | No |
| Setup Complexity | Standard Linux install | API key management | Account setup + billing |
Detailed comparisons: Comparison Pages
- Install Cortex Linux: Installation Guide
- Learn the AI API: AI Integration Guide
- Explore Examples: Use Cases and Tutorials
- Contribute: Developer Documentation
- Deploy to Cloud: Installation Guide - Cloud Deployment
- Configure Services: AI Integration - HTTP API
- Security Hardening: Security and Compliance
- Performance Tuning: Technical Specifications
- Security Assessment: Security and Compliance
- Compliance Review: Security and Compliance - Compliance Frameworks
- Architecture Planning: Technical Specifications
- Pilot Deployment: Installation Guide
- Installation Guide - Complete installation instructions for all platforms
- AI Integration Guide - API documentation and integration examples
- Use Cases and Tutorials - Real-world examples and code samples
- Technical Specifications - System architecture and performance details
- Developer Documentation - Contributing, building, and extending Cortex
- Security and Compliance - Security model and compliance information
- Comparison Pages - Technical comparisons with alternatives
- Roadmap and Changelog - Development roadmap and version history
- FAQ - Frequently asked questions
- GitHub Repository: github.com/cortexlinux/cortex
- Issue Tracker: github.com/cortexlinux/cortex/issues
- Documentation: This wiki
- Security Advisories: Security and Compliance - Security Advisories
- Discord: discord.gg/cortexlinux
- Matrix: #cortexlinux:matrix.org
- Reddit: r/cortexlinux
We welcome contributions from the community. See Developer Documentation - Contributing Guidelines for details.
Current Stable Release: 1.0.0
Latest Features:
- Sapiens 0.27B reasoning engine integration
- HTTP API endpoints for programmatic access
- Enhanced kernel with AI-aware scheduling
- Comprehensive security hardening
Full changelog: Roadmap and Changelog
Cortex Linux is distributed under the GNU General Public License v3.0 (GPL-3.0). The Sapiens reasoning engine components are licensed separately - see LICENSE files in the repository for details.
- π Installation Guide
- π€ AI Integration
- π Developer Docs
- π Security
- β FAQ
Traditional AI integration requires:
- External API calls: Every request costs money and time
- Data privacy concerns: Your data is sent to third-party servers
- Vendor lock-in: Dependency on external services
- Network dependency: Requires constant internet connection
- Latency overhead: Network round-trips add significant delay
- Compliance challenges: Data sovereignty issues
Cortex Linux solves these problems by:
- On-device processing: Zero API costs, complete data privacy
- No vendor lock-in: Open source, full control
- Offline capable: Works without internet connection
- Low latency: Sub-200ms response times
- Compliance ready: Data never leaves your infrastructure
Cost Savings Example:
- Traditional: 1M requests/month Γ $0.01/request = $10,000/month
- Cortex Linux: 1M requests/month Γ $0 = $0/month
- Annual Savings: $120,000
Privacy Benefits:
- No data transmission to external servers
- Complete audit trail under your control
- Suitable for air-gapped environments
- Compliance with strict regulations (GDPR, HIPAA, SOC2)
Performance Benefits:
- 3-8x faster than cloud APIs (no network latency)
- Consistent performance (no rate limits)
- Predictable resource usage
Unlike application-level AI tools, Cortex Linux integrates AI at the kernel level:
Traditional Approach:
Application β API Call β Network β Cloud Service β Response
Cortex Linux Approach:
Application β Kernel β AI Engine β Response
Benefits:
- Lower overhead: No network stack, no serialization
- Better scheduling: Kernel-aware AI workload management
- Resource efficiency: Direct memory access, optimized I/O
- Security: Kernel-level isolation and protection
The Sapiens 0.27B engine is optimized for on-device inference:
- Quantized Model: INT8 quantization reduces memory by 4x
- Optimized Kernels: SIMD-optimized operations (AVX2/AVX-512)
- Efficient Memory: Memory pools and caching reduce allocations
- Multi-threading: OpenMP parallelization for multi-core systems
Performance Characteristics:
- Model Size: 350MB (compressed), 200MB (in memory)
- Inference Speed: 50-200ms per query
- Throughput: 6-28 queries/second (depending on CPU cores)
- Memory Efficiency: ~200MB base + 10MB per request
Cortex Linux uses systemd for service management:
Services:
-
cortex-ai.service: Main AI service (HTTP API server) -
cortex-scheduler.service: Task scheduling and queuing -
cortex-monitor.service: System monitoring and metrics
Configuration:
- YAML-based configuration in
/etc/cortex-ai/config.yaml - Environment variable overrides
- Runtime configuration via API
Typical query processing time:
| Stage | Time | Description |
|---|---|---|
| Request Parsing | 1-2ms | Parse HTTP request/CLI input |
| Tokenization | 2-5ms | Convert text to tokens |
| Model Inference | 45-180ms | AI reasoning (main component) |
| Response Generation | 2-10ms | Format and return response |
| Total | 50-200ms | End-to-end latency |
Single-threaded Performance:
- 6.2 queries/second
- Limited by CPU single-core performance
- Suitable for low-volume use cases
Multi-threaded Performance:
- 4 cores: 18.5 queries/second (3x improvement)
- 8 cores: 28.3 queries/second (4.5x improvement)
- Diminishing returns beyond 8 cores (memory bandwidth limited)
Batch Processing (planned for v1.1.0):
- Up to 45+ queries/second with batching
- Efficient for high-volume scenarios
- Reduces per-request overhead
Memory Usage:
- Base: 200MB (model in memory)
- Per request: +10MB (temporary buffers)
- Cache: +50-100MB (if caching enabled)
- Total (typical): 250-350MB
CPU Usage:
- Idle: 2% (background tasks)
- Active (single request): 25-45% (single core)
- Active (multiple requests): Scales with cores
Disk I/O:
- Model loading: 350MB one-time read (on startup)
- Per request: <1MB (mostly logging)
- Minimal I/O during operation
Scenario: Production application generates error logs that need analysis.
Traditional Approach:
# Requires API key, network, costs money
import openai
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": f"Analyze: {error_log}"}]
)
# Cost: $0.002 per request
# Latency: 800-1500ms
# Privacy: Data sent to OpenAICortex Linux Approach:
# No API key, no network, zero cost
from cortex import AI
ai = AI()
response = ai.debug(error_log)
# Cost: $0
# Latency: 100-180ms
# Privacy: 100% on-deviceBenefits:
- 5-8x faster response
- Zero API costs
- Complete data privacy
- Works offline
Scenario: Optimize Ansible playbooks for better performance.
Traditional Approach:
- Manual review by senior engineers
- Time-consuming
- Inconsistent results
- Expensive (engineer time)
Cortex Linux Approach:
# Automated optimization
cortex-ai optimize /path/to/playbook.yml \
--target ansible \
--goals "performance,maintainability"Benefits:
- Instant analysis
- Consistent recommendations
- Cost-effective (automated)
- Can run in CI/CD pipeline
Scenario: Design microservices architecture for new project.
Traditional Approach:
- Multiple meetings with architects
- Weeks of planning
- Manual documentation
- High cost
Cortex Linux Approach:
# Generate architecture plan
cortex-ai plan "Design microservices architecture" \
--requirements requirements.json \
--output architecture.mdBenefits:
- Rapid prototyping
- Consistent documentation
- Cost-effective
- Iterative refinement
from cortex import AI
# Initialize
ai = AI(host='localhost', port=8080)
# Simple reasoning
result = ai.reason("What are best practices for API security?")
print(result.result)
# Debugging
debug_result = ai.debug(
error_log="KeyError: 'missing_key'",
context={"language": "Python", "framework": "Flask"}
)
for suggestion in debug_result.suggestions:
print(f"- {suggestion}")
# Planning
plan = ai.plan(
task="Deploy application to Kubernetes",
requirements=["High availability", "Auto-scaling"]
)
print(plan.plan)
# Optimization
optimization = ai.optimize(
code=open("script.py").read(),
language="python",
goals=["performance", "readability"]
)
print(optimization.optimizations[0].optimized_code)#!/bin/bash
# Function to query Cortex AI
cortex_reason() {
local query="$1"
curl -s -X POST http://localhost:8080/reason \
-H "Content-Type: application/json" \
-d "{\"query\": \"$query\"}" | \
jq -r '.result'
}
# Usage
ANALYSIS=$(cortex_reason "Analyze system performance metrics")
echo "$ANALYSIS"# Reason endpoint
curl -X POST http://localhost:8080/reason \
-H "Content-Type: application/json" \
-d '{
"query": "What is the difference between REST and GraphQL?",
"context": "API design",
"temperature": 0.7
}'
# Debug endpoint
curl -X POST http://localhost:8080/debug \
-H "Content-Type: application/json" \
-d '{
"error_log": "Traceback...",
"context": {"language": "Python"}
}'
# Plan endpoint
curl -X POST http://localhost:8080/plan \
-H "Content-Type: application/json" \
-d '{
"task": "Set up CI/CD pipeline",
"requirements": ["GitHub Actions", "Docker"]
}'Use Case: Local development machine
Configuration:
- Single instance
- Localhost-only API
- Development tools integration
- Minimal security requirements
Benefits:
- Fast iteration
- No API costs during development
- Privacy for sensitive code
Use Case: Pre-production testing
Configuration:
- Single or multiple instances
- Internal network access
- Monitoring enabled
- Security hardening
Benefits:
- Test AI integration before production
- Validate performance
- Security testing
Use Case: Live production systems
Configuration:
- High availability (multiple instances)
- Load balancing
- Full security hardening
- Comprehensive monitoring
- Backup and disaster recovery
Benefits:
- Reliable service
- Scalable architecture
- Compliance-ready
- Cost-effective at scale
Use Case: Secure/classified environments
Configuration:
- No network access
- Local installation only
- Enhanced security
- Audit logging
Benefits:
- Complete data isolation
- No external dependencies
- Compliance with strict regulations
Cortex Linux (3-year TCO for 1M requests/day):
| Component | Cost |
|---|---|
| Infrastructure (server) | $7,200 ($200/month) |
| Software licenses | $0 |
| API costs | $0 |
| Maintenance | $3,600 ($100/month) |
| Total (3 years) | $10,800 |
Cloud AI Service (3-year TCO for 1M requests/day):
| Component | Cost |
|---|---|
| Infrastructure | $0 (managed) |
| Software licenses | $0 |
| API costs | $1,095,000 ($10,950/month) |
| Maintenance | $0 (managed) |
| Total (3 years) | $1,095,000 |
Savings with Cortex Linux: $1,084,200 (99% reduction)
Break-even point: ~1,000 requests/day
- Below 1,000 requests/day: Cloud services may be cheaper (infrastructure costs)
- Above 1,000 requests/day: Cortex Linux is significantly cheaper
- Above 10,000 requests/day: Cortex Linux saves $10,000+/month
- Process Isolation: AI engine runs in isolated process
- No Network Access: No external communication by default
- Access Controls: API key authentication, IP whitelisting
- Audit Logging: Comprehensive audit trails
- Kernel Hardening: SELinux/AppArmor support
- Encryption: Support for TLS and data encryption
Cortex Linux is designed for compliance with:
- GDPR: On-device processing, no data transmission
- HIPAA: Encryption, access controls, audit logging
- SOC 2: Security controls, monitoring, audit
- PCI DSS: Network security, data protection
- FedRAMP: NIST 800-53 controls
See Security and Compliance for details.
- Installation: Installation Guide
- Integration: AI Integration Guide
- Use Cases: Use Cases and Tutorials
- Technical: Technical Specifications
- Security: Security and Compliance
- FAQ: FAQ
- GitHub Issues: Report bugs and request features
- Discord: Real-time community chat
- Matrix: Open-source chat alternative
- Reddit: Community discussions
Enterprise support options available. Contact: enterprise@cortexlinux.org
- β Sapiens 0.27B engine
- β HTTP API
- β CLI tool
- β Kernel enhancements
- β Security hardening
- π§ Performance optimizations
- π§ Batch processing
- π§ Advanced caching
- π§ Multi-model support
- π Role-based access control
- π High availability clustering
- π OAuth2 authentication
- π Enhanced compliance features
- π Fine-tuning support
- π GPU acceleration
- π Plugin system
- π Model marketplace
See Roadmap and Changelog for details.
- π Installation Guide
- π€ AI Integration
- π Developer Docs
- π Security
- β FAQ
Last updated: 2024