Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Chunking: Inteligentny podział dokumentów
  • Embeddings: SentenceTransformers (all-MiniLM-L6-v2)
  • Vector DB: ChromaDB z kompresją
  • Retrieval: Hybrydowy (semantic + keyword)

Code Generation

  • Python: Generowanie skryptów, funkcji, klas
  • Bash: Automatyzacja, scripting systemowy
  • Templates: Gotowe wzorce kodu
  • Validation: Sprawdzanie składni

Edge Optimizations

  • Model Caching: Inteligentne cache'owanie
  • Memory Management: Optymalizacja RAM
  • CPU Scheduling: Priorytetyzacja zadań
  • Quantization: Q4_0, Q2_K support

📊 Monitoring

Metryki wydajności

  • Czas odpowiedzi modelu
  • Zużycie pamięci RAM
  • Temperatura CPU
  • Przepustowość I/O

Dashboards

  • Grafana + Prometheus
  • Lokalny web dashboard
  • CLI monitoring tools

🔧 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

  • Sandboxing: Bezpieczne wykonywanie kodu
  • Input Validation: Sanityzacja wejść
  • Rate Limiting: Ochrona przed nadużyciem
  • Access Control: Kontrola dostępu

📈 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 🦅

Releases

Packages

Contributors