assistant

WronAI - Edge Computing AI Assistant

πŸ—οΈ Struktura Projektu

wronai/
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ setup.py
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ .env.example
β”œβ”€β”€ 
β”œβ”€β”€ src/wronai/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ llm_manager.py      # ZarzΔ…dzanie modelami
β”‚   β”‚   β”œβ”€β”€ rag_engine.py       # RAG pipeline
β”‚   β”‚   └── code_generator.py   # Generowanie kodu
β”‚   β”‚
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ embeddings.py       # Modele embeddingΓ³w
β”‚   β”‚   └── quantized/          # Kwantyzowane modele
β”‚   β”‚
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ knowledge_base/     # Baza wiedzy
β”‚   β”‚   β”œβ”€β”€ vectors/           # Baza wektorowa
β”‚   β”‚   └── cache/             # Cache
β”‚   β”‚
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ main.py            # FastAPI app
β”‚   β”‚   β”œβ”€β”€ endpoints/
β”‚   β”‚   └── middleware/
β”‚   β”‚
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ python_agent.py    # Agent Python
β”‚   β”‚   β”œβ”€β”€ bash_agent.py      # Agent Bash
β”‚   β”‚   └── rag_agent.py       # Agent RAG
β”‚   β”‚
β”‚   └── utils/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ monitoring.py      # Monitoring wydajnoΕ›ci
β”‚       β”œβ”€β”€ optimization.py    # Optymalizacje
β”‚       └── security.py       # BezpieczeΕ„stwo
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ unit/
β”‚   β”œβ”€β”€ integration/
β”‚   └── performance/
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ install_models.sh     # Instalacja modeli
β”‚   β”œβ”€β”€ setup_rpi.sh         # Setup RPi
β”‚   └── benchmark.py         # Testy wydajnoΕ›ci
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ installation.md
β”‚   β”œβ”€β”€ configuration.md
β”‚   β”œβ”€β”€ api_reference.md
β”‚   └── examples/
β”‚
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ basic_rag.py
β”‚   β”œβ”€β”€ code_generation.py
β”‚   └── edge_deployment.py
β”‚
└── deployment/
    β”œβ”€β”€ docker/
    β”‚   β”œβ”€β”€ Dockerfile.rpi
    β”‚   └── Dockerfile.dev
    β”œβ”€β”€ k8s/
    └── ansible/

πŸš€ Quickstart dla RPi Zero

1. Instalacja podstawowa

# Klonowanie repo
git clone https://github.com/wronai/www.git
cd wronai

# Setup Ε›rodowiska
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Instalacja Ollama (ARM64)
curl -fsSL https://ollama.ai/install.sh | sh

2. Pobieranie modelu

# Llama 3.2 1B (kwantyzowany)
ollama pull llama3.2:1b-instruct-q4_0

# Lub TinyLlama
ollama pull tinyllama:1.1b-chat-v1.0-q4_0

3. Uruchomienie

# Start WronAI
python -m wronai.api.main

# Lub z Docker
docker-compose up -d

🎯 Kluczowe Features

RAG Engine

Code Generation

Edge Optimizations

πŸ“Š Monitoring

Metryki wydajnoΕ›ci

Dashboards

πŸ”§ Konfiguracja

Environment Variables

# Model settings
WRONAI_MODEL_NAME=llama3.2:1b-instruct-q4_0
WRONAI_MAX_TOKENS=512
WRONAI_TEMPERATURE=0.7

# RAG settings
WRONAI_CHUNK_SIZE=256
WRONAI_CHUNK_OVERLAP=50
WRONAI_TOP_K=5

# Performance
WRONAI_CACHE_SIZE=100MB
WRONAI_MAX_CONCURRENT=2

🎨 Usage Examples

Basic RAG Query

from wronai import WronAI

ai = WronAI()
ai.load_documents("./docs")

response = ai.query(
    "Jak zoptymalizować Python na RPi?",
    context_limit=3
)
print(response)

Code Generation

code = ai.generate_code(
    "Napisz funkcjΔ™ do monitorowania temperatury CPU",
    language="python",
    style="modern"
)
print(code)

Bash Automation

script = ai.generate_bash(
    "Skrypt backupu z rotacjΔ… logΓ³w",
    features=["compression", "cleanup", "logging"]
)
print(script)

πŸ›‘οΈ Security Features

πŸ“ˆ Performance Benchmarks

Model RAM Usage Inference Time Tokens/sec
Llama3.2-1B-Q4 ~800MB ~2.5s ~15
TinyLlama-Q4 ~600MB ~1.8s ~20
Phi-3.5-mini-Q2 ~1.2GB ~3.2s ~12

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

πŸ“„ License

Apache License - zobacz LICENSE file.

WronAI - Inteligentny asystent AI dla edge computing πŸ¦