Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Llama-ZIM Integrated System (Low-Hardware Edition)

Screenshot_2026-06-16_19_48_31

๐Ÿ“– English Version

License: MIT Python 3.8+ CPU Only RAM 2-8GB

Fully offline Arabic AI assistant with RAG (Retrieval-Augmented Generation) on ZIM archives. Optimized for low-resource devices (2โ€“8GB RAM, CPU only). Comes with 25+ builtโ€‘in skills (PDF, DOCX, XLSX, PPTX, web art, coding, design, etc.).

โœจ Key Features

  • llama.cpp engine โ€“ Runs on CPU, no GPU required.
  • Arabic RAG system โ€“ Search Wikipedia / dictionaries from ZIM files (e.g., wiktionary_ar_mini.zim).
  • Vector database โ€“ Uses Chroma DB for fast similarity search.
  • 25+ skills โ€“ Readyโ€‘toโ€‘use: PDF, DOCX, XLSX, PPTX, canvas design, algorithmic art, web testing, MCP builder, Slack GIF creator, theme factory, and more (see skills/ folder).
  • Smart memory โ€“ Maintains conversation context.
  • Offline-first โ€“ Complete privacy, no internet needed.

๐Ÿ“‹ Requirements

  • OS: Linux, Windows, macOS
  • RAM: 2GB (small models) โ€“ 8GB (larger models)
  • CPU: Any modern processor (AVX2 recommended)
  • Storage: ~5GB for models + ZIM file size
  • Software: Python 3.8+, pip, git

๐Ÿ› ๏ธ Installation & Usage

1. Clone the repository

git clone https://github.com/AHX47/llamaZIM.git
cd LlamaZIM

2. Install dependencies

pip install -r requirements.txt

3. Place a GGUF model

Download a GGUF model (e.g., SmolLM2-135M-Q4_K_M.gguf) and put it inside:

models/SmolLM2-135M-Instruct-GGUF/

Your current structure already contains that folder โ€“ ensure the .gguf file is directly inside it.

4. Place ZIM archives

Put your ZIM files (e.g., wiktionary_ar_mini.zim) inside:

zim_archives/

5. Index the ZIM files (first time only)

python3 main.py --index

This will create/update the vector database inside vector_db/ (Chroma).

6. Run the system

python3 main.py

You can also test individual components with:

python3 test_system.py

๐Ÿง  Recommended Models (GGUF format)

Model Size RAM Use case
SmolLM2-135M 135M 2GB Very weak devices, fast
Gemma-3-270M 270M 3โ€“4GB Balanced
DeepSeek-Coder-1.3B 1.3B 3โ€“8GB Programming & logic
DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M 1.3B 4โ€“8GB Programming & logic & thinking ...

๐Ÿ“ Project Structure (as on your disk)

llamaZIM/
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ config.yaml
โ”œโ”€โ”€ models/
โ”‚   โ””โ”€โ”€ SmolLM2-135M-Instruct-GGUF/   # put .gguf here
โ”œโ”€โ”€ zim_archives/
โ”‚   โ””โ”€โ”€ wiktionary_ar_mini.zim
โ”œโ”€โ”€ vector_db/
โ”‚   โ””โ”€โ”€ chroma.sqlite3                # created after --index
โ”œโ”€โ”€ skills/                           # 25+ ready-to-use skills
โ”‚   โ”œโ”€โ”€ pdf/
โ”‚   โ”œโ”€โ”€ docx/
โ”‚   โ”œโ”€โ”€ xlsx/
โ”‚   โ”œโ”€โ”€ pptx/
โ”‚   โ”œโ”€โ”€ canvas-design/
โ”‚   โ”œโ”€โ”€ algorithmic-art/
โ”‚   โ”œโ”€โ”€ webapp-testing/
โ”‚   โ”œโ”€โ”€ mcp-builder/
โ”‚   โ”œโ”€โ”€ slack-gif-creator/
โ”‚   โ”œโ”€โ”€ theme-factory/
โ”‚   โ””โ”€โ”€ ... (more)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/          # model_manager.py, skill_manager.py
โ”‚   โ”œโ”€โ”€ rag/           # zim_manager.py (handles ZIM + Chroma)
โ”‚   โ”œโ”€โ”€ agents/        # agent_manager.py
โ”‚   โ””โ”€โ”€ cli/           # (future CLI interface)
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ test_system.py
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿ” How RAG works with ZIM

  • The system reads ZIM files (e.g., Arabic Wiktionary) and indexes them into ChromaDB (vector_db/).
  • When you ask a question, it retrieves relevant passages from the ZIM archive and feeds them to the LLM as context.
  • This enables offline, private questionโ€‘answering over Arabic Wikipedia / dictionaries.

๐Ÿงฉ Skill Management

All skills are located in the skills/ folder. The system automatically discovers them. You can enable/disable skills via config/config.yaml or through the skill manager.

Example config.yaml (partial):

model:
  path: "models/SmolLM2-135M-Instruct-GGUF/smollm2-135m-q4_k_m.gguf"
  context_size: 2048
skills:
  enabled:
    - pdf
    - docx
    - xlsx
    - canvas-design
  disabled:
    - webapp-testing   # requires optional dependencies
rag:
  
# RAG Settings
embedding_model_name: "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2" # A good multilingual model
vector_db_path: "/home/ubuntu/llama_zim_system/vector_db"
chunk_size: 512
chunk_overlap: 50

# Agent Settings
agent_framework: "LangGraph" # Options: CrewAI, LangGraph, Smolagents

# Skills Settings
enabled_skills:
  - "pdf-reading"
  - "docx"
  - "pptx"
  - "xlsx"
  # Add custom ZIM skills here later
                                         
  zim_path: "zim_archives/"
  vector_db_path: "vector_db/"

๐Ÿ”ง Troubleshooting

Issue Solution
ModuleNotFoundError Run pip install -r requirements.txt again
No results from RAG Run python3 main.py --index to build vector DB
Model not found Check the path in config.yaml โ€“ point to the actual .gguf file
High RAM usage Use a smaller model or reduce context_size in config

๐Ÿ› ๏ธ Development

  • To add a new skill: create a folder under skills/ with a SKILL.md description and any Python scripts. The skill manager will pick it up.
  • To modify RAG: edit src/rag/zim_manager.py.

๐Ÿ“„ License

MIT โ€“ free to use, modify, and distribute.

๐Ÿ™ Acknowledgements


๐Ÿ“– ุงู„ู†ุณุฎุฉ ุงู„ุนุฑุจูŠุฉ

ู†ุธุงู… Llama-ZIM ุงู„ู…ุชูƒุงู…ู„ (ู„ู„ุฃุฌู‡ุฒุฉ ุงู„ุถุนูŠูุฉ) ๐Ÿš€

ู…ุณุงุนุฏ ุฐูƒุงุก ุงุตุทู†ุงุนูŠ ุนุฑุจูŠ ูŠุนู…ู„ ุฏูˆู† ุงุชุตุงู„ุŒ ู…ุน ู†ุธุงู… RAG ุนู„ู‰ ุฃุฑุดูŠูุงุช ZIM. ูŠุนู…ู„ ุนู„ู‰ ุงู„ู…ุนุงู„ุฌ ูู‚ุท (2-8 ุฌูŠุฌุงุจุงูŠุช ุฑุงู…). ูŠุชุถู…ู† ุฃูƒุซุฑ ู…ู† 25 ู…ู‡ุงุฑุฉ ู…ุฏู…ุฌุฉ (PDF, DOCX, XLSX, PPTX, ุชุตู…ูŠู…ุŒ ุจุฑู…ุฌุฉุŒ ูˆุบูŠุฑู‡ุง).

โœจ ุงู„ู…ู…ูŠุฒุงุช

  • ู…ุญุฑูƒ llama.cpp โ€“ ูŠุนู…ู„ ุนู„ู‰ ุงู„ู…ุนุงู„ุฌ ูู‚ุท.
  • RAG ุนุฑุจูŠ โ€“ ุงุณุชุนู„ุงู… ุฃุฑุดูŠูุงุช ZIM (ู…ุซู„ ูˆูŠูƒูŠุจูŠุฏูŠุงุŒ ุงู„ู‚ูˆุงู…ูŠุณ).
  • ู‚ุงุนุฏุฉ ุจูŠุงู†ุงุช ู…ุชุฌู‡ุงุช Chroma โ€“ ุจุญุซ ุณุฑูŠุน.
  • 25+ ู…ู‡ุงุฑุฉ โ€“ ุฌุงู‡ุฒุฉ ู„ู„ุงุณุชุฎุฏุงู… (ุงู†ุธุฑ ู…ุฌู„ุฏ skills/).
  • ุฐุงูƒุฑุฉ ุงู„ู…ุญุงุฏุซุฉ โ€“ ุณูŠุงู‚ ุฐูƒูŠ.
  • ุจุฏูˆู† ุฅู†ุชุฑู†ุช โ€“ ุฎุตูˆุตูŠุฉ ุชุงู…ุฉ.

๐Ÿ“‹ ุงู„ู…ุชุทู„ุจุงุช

  • ู†ุธุงู… ุชุดุบูŠู„: Linux, Windows, macOS
  • ุฑุงู…: 2-8 ุฌูŠุฌุงุจุงูŠุช
  • ู…ุณุงุญุฉ: 5 ุฌูŠุฌุงุจุงูŠุช + ุญุฌู… ู…ู„ูุงุช ZIM
  • Python 3.8+ุŒ pipุŒ git

๐Ÿ› ๏ธ ุงู„ุชุดุบูŠู„

git clone https://github.com/AHX47/llamaZIM.git
cd LlamaZIM
pip install -r requirements.txt
# ุถุน ู†ู…ูˆุฐุฌ GGUF ููŠ ู…ุฌู„ุฏ models/ ูˆู…ู„ู ZIM ููŠ zim_archives/
python3 main.py --index   # ู…ุฑุฉ ูˆุงุญุฏุฉ ู„ู„ูู‡ุฑุณุฉ
python3 main.py

๐Ÿ“ ู‡ูŠูƒู„ ุงู„ู…ุดุฑูˆุน (ูƒู…ุง ู‡ูˆ ุนู„ู‰ ุฌู‡ุงุฒูƒ)

  • models/ โ€“ ู†ู…ุงุฐุฌ GGUF
  • zim_archives/ โ€“ ู…ู„ูุงุช ZIM (ู…ุซู„ wiktionary_ar_mini.zim)
  • vector_db/ โ€“ ูู‡ุฑุณ Chroma (ูŠู†ุดุฃ ุชู„ู‚ุงุฆูŠุงู‹)
  • skills/ โ€“ ุงู„ู…ู‡ุงุฑุงุช (PDFุŒ DOCXุŒ ุฅู„ุฎ)
  • src/ โ€“ ุงู„ูƒูˆุฏ ุงู„ู…ุตุฏุฑูŠ (core, rag, agents)
  • main.py โ€“ ู†ู‚ุทุฉ ุงู„ุฏุฎูˆู„

๐Ÿงฉ ุฅุฏุงุฑุฉ ุงู„ู…ู‡ุงุฑุงุช

ุงู„ู…ู‡ุงุฑุงุช ู…ูˆุฌูˆุฏุฉ ููŠ ู…ุฌู„ุฏ skills/. ูŠู…ูƒู†ูƒ ุชูุนูŠู„ู‡ุง ุฃูˆ ุชุนุทูŠู„ู‡ุง ู…ู† config/config.yaml.

๐Ÿ”ง ุญู„ ุงู„ู…ุดูƒู„ุงุช

  • RAG ู„ุง ูŠุนู…ู„ โ†’ ุดุบู„ python3 main.py --index ู…ุฑุฉ ุฃุฎุฑู‰.
  • ุงู„ู†ู…ูˆุฐุฌ ุบูŠุฑ ู…ูˆุฌูˆุฏ โ†’ ุชุฃูƒุฏ ู…ู† ุงู„ู…ุณุงุฑ ููŠ config.yaml.
  • ุงุณุชู‡ู„ุงูƒ ุฑุงู… ุนุงู„ูŠ โ†’ ุงุณุชุฎุฏู… ู†ู…ูˆุฐุฌุงู‹ ุฃุตุบุฑ.

๐Ÿ“„ ุงู„ุฑุฎุตุฉ

MIT โ€“ ุญุฑูŠุฉ ุงู„ุงุณุชุฎุฏุงู… ูˆุงู„ุชุนุฏูŠู„.


โœจ ุชู… ุชุทูˆูŠุฑ ู‡ุฐุง ุงู„ู†ุธุงู… ู„ูŠูƒูˆู† ู…ุตู†ุน ู…ุนุฑูุฉ ุดุฎุตูŠ ูŠุนู…ู„ ุฏูˆู† ุงุชุตุงู„ ุนู„ู‰ ุฃูŠ ุฌู‡ุงุฒ. โœจ


---

About

Offline Arabic/English AI assistant with RAG on ZIM archives. Runs on 2-8GB RAM, CPU only.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages