An AI-powered OS companion. One binary. Local-first intelligence. CLI + Desktop.
Rust
0
2 commits
updated Mar 3, 2026
One binary. AI inference, package management, system utilities, and a built-in Arch Linux assistant.
koompi install, koompi server, koompi ask.# Build from source
cargo build --release
cp target/release/koompi /usr/local/bin/
# Initialize configuration
koompi config init
# Download a GGUF model (recommended for CPU)
koompi download TheBloke/Llama-2-7B-Chat-GGUF
# Ask the AI assistant a question
koompi ask "how to fix broken pacman keyring"
# Start the inference server
koompi server ./path/to/model.gguf --port 8000
# Install a package
koompi install firefox
# Check system health
koompi sys health
koompi includes a production-grade inference engine built on the candle framework:
| Feature | Details |
|---|---|
| Model formats | GGUF (quantized), SafeTensors (full-precision) |
| Architectures | Llama 2/3, Mistral, Phi-3, CodeLlama |
| Sampling | Temperature, Top-K, Top-P (nucleus), Repetition penalty |
| Chat templates | Llama 2, Llama 3, Mistral, ChatML — auto-detected |
| API | OpenAI-compatible (/v1/chat/completions) |
| Streaming | Server-Sent Events (SSE) with [DONE] sentinel |
| Devices | CPU (default), CUDA, Metal |
# Start with a GGUF model
koompi server ./model-q4_k_m.gguf
# Full options
koompi server ./model.gguf \
--host 0.0.0.0 \
--port 8000 \
--context-length 4096 \
--max-tokens 2048 \
--temperature 0.7 \
--api-key my-secret-key
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="my-secret-key", # or "not-needed" if no key set
)
response = client.chat.completions.create(
model="local",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain btrfs snapshots"},
],
temperature=0.7,
max_tokens=512,
stream=True,
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
# Or use curl
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my-secret-key" \
-d '{
"model": "local",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 256
}'
# Ask a question
koompi ask "how to install nvidia drivers on arch"
# Include system context (disk, memory, packages, failed services)
koompi ask "why is my system slow" --with-context
# Specify a model
koompi ask --model ./mistral.gguf "explain systemd timers"
# Interactive chat session
koompi chat
# Download from HuggingFace
koompi download TheBloke/Mistral-7B-Instruct-v0.2-GGUF
# List downloaded models
koompi list --models
# Show AI system info (GPU, memory, SIMD, recommended models)
koompi info --ai
# Benchmark a model
koompi bench ./model.gguf --prompts 50
# Install packages (pacman -S)
koompi install firefox vlc
# Install from AUR
koompi install google-chrome --aur
# Remove with dependencies (pacman -Rns)
koompi remove firefox --with-deps
# Full system update (pacman -Syu)
koompi update
# Update including AUR
koompi update --aur
# Search repos and AUR
koompi search firefox --all
# Clean package cache
koompi clean --aggressive
# Remove orphan packages
koompi orphan --remove
koompi sys info # System information
koompi sys health # Health check (disk, RAM, systemd, pacman DB)
koompi sys disk # Disk usage analysis
koompi sys memory # Memory usage analysis
koompi sys optimize # Optimization suggestions
koompi config init # Create default config
koompi config set ai.port 8080
koompi config get ai.port
Config file: ~/.config/koompi/config.toml
# CPU-only (default)
cargo build --release
# With CUDA GPU acceleration
cargo build --release --features cuda
# With Metal GPU acceleration (macOS)
cargo build --release --features metal
cargo test # 49 tests across 6 suites
src/
├── main.rs # Entry point
├── lib.rs # Library root
├── cli/commands.rs # Flat CLI definitions (clap)
├── ai/
│ ├── inference.rs # InferenceEngine — autoregressive generation loop
│ ├── model_loader.rs # ModelBackend — Llama/Mistral/QuantizedLlama/QuantizedPhi3
│ ├── sampler.rs # LogitsProcessor — temperature, top-k, top-p, repeat penalty
│ ├── tokenizer.rs # TokenizerWrapper — HuggingFace tokenizers + chat templates
│ ├── server.rs # Axum HTTP server
│ ├── assistant.rs # Built-in AI assistant (ask/chat)
│ ├── model.rs # Model download, list, info, benchmark
│ ├── api/
│ │ ├── mod.rs # OpenAI-compatible request/response types
│ │ ├── handlers.rs # Endpoint implementations
│ │ └── routes.rs # Router
│ └── cache/kv_cache.rs # Standalone KV cache for custom extensions
├── pkg/ # Package management (pacman, AUR, safety)
├── sys/ # System utilities
├── config/ # TOML configuration
└── utils/ # Output formatting, progress bars
User Prompt
↓
TokenizerWrapper.encode() → token IDs
↓
ModelBackend.forward() → logits (prefill: entire prompt)
↓
LogitsProcessor.sample() → first token
↓
┌───────────────────────────────────┐
│ Autoregressive Decode Loop │
│ ModelBackend.forward(token, pos) │
│ LogitsProcessor.sample(logits) │
│ Check EOS / stop sequences │
│ Emit token via callback │
└────────────┬──────────────────────┘
↓
TokenizerWrapper.decode() → generated text
MIT OR Apache-2.0
2 commits
Rust
100.0%
An AI-powered OS companion. One binary. Local-first intelligence. CLI + Desktop.
Rust
0
2 commits
updated Mar 3, 2026
One binary. AI inference, package management, system utilities, and a built-in Arch Linux assistant.
koompi install, koompi server, koompi ask.# Build from source
cargo build --release
cp target/release/koompi /usr/local/bin/
# Initialize configuration
koompi config init
# Download a GGUF model (recommended for CPU)
koompi download TheBloke/Llama-2-7B-Chat-GGUF
# Ask the AI assistant a question
koompi ask "how to fix broken pacman keyring"
# Start the inference server
koompi server ./path/to/model.gguf --port 8000
# Install a package
koompi install firefox
# Check system health
koompi sys health
koompi includes a production-grade inference engine built on the candle framework:
| Feature | Details |
|---|---|
| Model formats | GGUF (quantized), SafeTensors (full-precision) |
| Architectures | Llama 2/3, Mistral, Phi-3, CodeLlama |
| Sampling | Temperature, Top-K, Top-P (nucleus), Repetition penalty |
| Chat templates | Llama 2, Llama 3, Mistral, ChatML — auto-detected |
| API | OpenAI-compatible (/v1/chat/completions) |
| Streaming | Server-Sent Events (SSE) with [DONE] sentinel |
| Devices | CPU (default), CUDA, Metal |
# Start with a GGUF model
koompi server ./model-q4_k_m.gguf
# Full options
koompi server ./model.gguf \
--host 0.0.0.0 \
--port 8000 \
--context-length 4096 \
--max-tokens 2048 \
--temperature 0.7 \
--api-key my-secret-key
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="my-secret-key", # or "not-needed" if no key set
)
response = client.chat.completions.create(
model="local",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain btrfs snapshots"},
],
temperature=0.7,
max_tokens=512,
stream=True,
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
# Or use curl
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my-secret-key" \
-d '{
"model": "local",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 256
}'
# Ask a question
koompi ask "how to install nvidia drivers on arch"
# Include system context (disk, memory, packages, failed services)
koompi ask "why is my system slow" --with-context
# Specify a model
koompi ask --model ./mistral.gguf "explain systemd timers"
# Interactive chat session
koompi chat
# Download from HuggingFace
koompi download TheBloke/Mistral-7B-Instruct-v0.2-GGUF
# List downloaded models
koompi list --models
# Show AI system info (GPU, memory, SIMD, recommended models)
koompi info --ai
# Benchmark a model
koompi bench ./model.gguf --prompts 50
# Install packages (pacman -S)
koompi install firefox vlc
# Install from AUR
koompi install google-chrome --aur
# Remove with dependencies (pacman -Rns)
koompi remove firefox --with-deps
# Full system update (pacman -Syu)
koompi update
# Update including AUR
koompi update --aur
# Search repos and AUR
koompi search firefox --all
# Clean package cache
koompi clean --aggressive
# Remove orphan packages
koompi orphan --remove
koompi sys info # System information
koompi sys health # Health check (disk, RAM, systemd, pacman DB)
koompi sys disk # Disk usage analysis
koompi sys memory # Memory usage analysis
koompi sys optimize # Optimization suggestions
koompi config init # Create default config
koompi config set ai.port 8080
koompi config get ai.port
Config file: ~/.config/koompi/config.toml
# CPU-only (default)
cargo build --release
# With CUDA GPU acceleration
cargo build --release --features cuda
# With Metal GPU acceleration (macOS)
cargo build --release --features metal
cargo test # 49 tests across 6 suites
src/
├── main.rs # Entry point
├── lib.rs # Library root
├── cli/commands.rs # Flat CLI definitions (clap)
├── ai/
│ ├── inference.rs # InferenceEngine — autoregressive generation loop
│ ├── model_loader.rs # ModelBackend — Llama/Mistral/QuantizedLlama/QuantizedPhi3
│ ├── sampler.rs # LogitsProcessor — temperature, top-k, top-p, repeat penalty
│ ├── tokenizer.rs # TokenizerWrapper — HuggingFace tokenizers + chat templates
│ ├── server.rs # Axum HTTP server
│ ├── assistant.rs # Built-in AI assistant (ask/chat)
│ ├── model.rs # Model download, list, info, benchmark
│ ├── api/
│ │ ├── mod.rs # OpenAI-compatible request/response types
│ │ ├── handlers.rs # Endpoint implementations
│ │ └── routes.rs # Router
│ └── cache/kv_cache.rs # Standalone KV cache for custom extensions
├── pkg/ # Package management (pacman, AUR, safety)
├── sys/ # System utilities
├── config/ # TOML configuration
└── utils/ # Output formatting, progress bars
User Prompt
↓
TokenizerWrapper.encode() → token IDs
↓
ModelBackend.forward() → logits (prefill: entire prompt)
↓
LogitsProcessor.sample() → first token
↓
┌───────────────────────────────────┐
│ Autoregressive Decode Loop │
│ ModelBackend.forward(token, pos) │
│ LogitsProcessor.sample(logits) │
│ Check EOS / stop sequences │
│ Emit token via callback │
└────────────┬──────────────────────┘
↓
TokenizerWrapper.decode() → generated text
MIT OR Apache-2.0
2 commits
Rust
100.0%