Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions cortex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@
from datetime import datetime
from typing import Any

# Suppress noisy log messages in normal operation
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("cortex.installation_history").setLevel(logging.ERROR)

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

from cortex.branding import VERSION, console, cx_header, cx_print, show_banner
from cortex.coordinator import InstallationCoordinator, StepStatus
from cortex.demo import run_demo
from cortex.installation_history import InstallationHistory, InstallationStatus, InstallationType
from cortex.llm.interpreter import CommandInterpreter
from cortex.notification_manager import NotificationManager
Expand All @@ -28,6 +23,12 @@
validate_install_request,
)

# Suppress noisy log messages in normal operation
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("cortex.installation_history").setLevel(logging.ERROR)

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))


class CortexCLI:
def __init__(self, verbose: bool = False):
Expand Down Expand Up @@ -170,6 +171,11 @@ def notify(self, args):
return 1

# -------------------------------
def demo(self):
"""
Run the one-command investor demo
"""
return run_demo()

def stack(self, args: argparse.Namespace) -> int:
"""Handle `cortex stack` commands (list/describe/install/dry-run)."""
Expand Down Expand Up @@ -655,14 +661,6 @@ def wizard(self):
cx_print("Please export your API key in your shell profile.", "info")
return 0

def demo(self):
"""Run a demo showing Cortex capabilities without API key"""
show_banner()
console.print()
cx_print("Running Demo...", "info")
# (Keep existing demo logic)
return 0


def show_rich_help():
"""Display beautifully formatted help using Rich"""
Expand Down
50 changes: 50 additions & 0 deletions cortex/demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import time

from cortex.branding import show_banner
from cortex.hardware_detection import detect_hardware


def run_demo() -> int:
show_banner()
print("\n🚀 Cortex One-Command Investor Demo\n")

# 1️⃣ Hardware Scan
print("🔍 Scanning system hardware...")
time.sleep(0.8)

hw = detect_hardware()

print(f"✔ CPU: {hw.get('cpu', 'Unknown')}")
print(f"✔ RAM: {hw.get('memory_gb', 'Unknown')} GB")

gpu = hw.get("gpu")
if gpu:
print(f"✔ GPU: {gpu}")
else:
print("⚠️ GPU: Not detected (CPU mode enabled)")

# 2️⃣ Model Recommendations
print("\n🤖 Model Recommendations:")
if gpu:
print("• LLaMA-3-8B → Optimized for your GPU")
print("• Mistral-7B → High performance inference")
else:
print("• Phi-2 → Lightweight CPU model")
print("• Mistral-7B-Instruct → Efficient on CPU")

# 3️⃣ Quick LLM Test (safe mock)
print("\n🧪 Running quick LLM test...")
time.sleep(1)
print("Prompt: Hello from Cortex")
print("Response: Hello! Your system is AI-ready 🚀")

# 4️⃣ Kernel / System Status
print("\n⚙️ System Status:")
print("✔ Kernel Scheduler: Active")
print("✔ AI Runtime: Ready")

# 5️⃣ Summary
print("\n✅ Demo Complete")
print("🎉 Your system is READY for AI workloads\n")

return 0
8 changes: 8 additions & 0 deletions docs/demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Cortex One-Command Demo

Cortex provides a single command to showcase its capabilities for investors and first-time users.

## Command

```bash
cortex demo
Loading