--- language: - id - en - ar license: mit base_model: Qwen/Qwen2.5-7B-Instruct tags: - ai-agent - lora - qwen - self-hosted - open-source - free - rag - epistemology - indonesia - islamic-epistemology - local-ai - agentic-ai - peft - safetensors - text-generation pipeline_tag: text-generation library_name: peft --- # SIDIX LoRA โ€” Free & Open Source AI Agent > *"Thinks, Learns & Creates."* **SIDIX** is an autonomous AI agent that runs 100% locally โ€” no per-query cost, no data leaves your server, no vendor lock-in. This repository hosts the **LoRA adapter** fine-tuned on top of [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) using QLoRA (4-bit NF4 quantization, Kaggle T4 GPU). It is the language-model component of the larger SIDIX agent system, which adds RAG, 48 tools, ReAct loop, semantic cache, and a continuous-learning growth loop on top. ๐Ÿ”— **GitHub (full agent)**: [github.com/fahmiwol/sidix](https://github.com/fahmiwol/sidix) ๐ŸŒ **Live Demo (Free)**: [app.sidixlab.com](https://app.sidixlab.com) ๐Ÿ“œ **License**: MIT ๐Ÿท๏ธ **Latest version**: v2.1.4 (Vol 20-fu3, 2026-04-26) --- ## What's Different about SIDIX? | Property | SIDIX | Closed-Vendor AI | |---|---|---| | Inference cost | **Free** (own GPU/CPU) | Per-token billing | | Data egress | **Stays on your server** | Sent to vendor cloud | | Open-source | โœ… MIT โ€” adapter + agent + corpus | Closed | | Self-hostable | โœ… End-to-end | โŒ | | Vendor LLM API fallback | โŒ Never (`brain_qa` core has zero `openai`/`anthropic`/`google` imports) | N/A | | Epistemic labeling | `[FACT] / [OPINION] / [SPECULATION] / [UNKNOWN]` on sensitive claims | Generic disclaimer | | Growth loop | LoRA retrains nightly from corpus queue | Static snapshot | --- ## Architecture (One Glance) ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ brain_qa (FastAPI, VPS or your laptop) โ”‚ โ”‚ โ”€ ReAct loop ยท 48 tools ยท sanad chain โ”‚ โ”‚ โ”€ Semantic cache (BGE-M3 embedding, per-domain TTL) โ”‚ โ”‚ โ”€ Complexity router (simple / standard / deep) โ”‚ โ”‚ โ”€ Domain detector (fiqh / medis / coding / factual) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ HTTP โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ vLLM (this LoRA on Qwen2.5-7B-Instruct base) โ”‚ โ”‚ โ”€ Self-hosted (RunPod serverless / your GPU) โ”‚ โ”‚ โ”€ Returns generative output, ReAct + RAG handled by โ”‚ โ”‚ brain_qa above โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` The adapter alone gives you SIDIX's **voice and behavior**. For the full agent (RAG, tools, growth loop) clone the [GitHub repo](https://github.com/fahmiwol/sidix) โ€” that ties this adapter into the orchestration layer. --- ## Quick Start ### A. Standalone (transformers + peft) ```python from peft import PeftModel from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig import torch bnb = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_compute_dtype=torch.float16, bnb_4bit_quant_type="nf4", ) base = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen2.5-7B-Instruct", quantization_config=bnb, device_map="auto", ) model = PeftModel.from_pretrained(base, "Tiranyx/sidix-lora") tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct") # SIDIX uses Qwen2.5 chat template + persona-flavored system prompt messages = [ {"role": "system", "content": "Kamu adalah SIDIX, AI agent yang jujur dan bersumber. " "Persona aktif: AYMAN (general/hangat). Jawab natural; untuk klaim " "fiqh/medis/data, beri label [FAKTA]/[OPINI]/[TIDAK TAHU] + sumber."}, {"role": "user", "content": "Apa beda RAG sama fine-tuning untuk knowledge update?"}, ] text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) inputs = tok([text], return_tensors="pt").to(model.device) out = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True) print(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)) ``` ### B. Via vLLM (Production) ```bash vllm serve Qwen/Qwen2.5-7B-Instruct \ --enable-lora \ --lora-modules sidix=Tiranyx/sidix-lora \ --max-lora-rank 64 ``` ### C. Full agent (RAG + tools + growth loop) ```bash git clone https://github.com/fahmiwol/sidix && cd sidix # Follow README โ€” quick start ~5 min ``` --- ## Training Details | Parameter | Value | |---|---| | Base model | `Qwen/Qwen2.5-7B-Instruct` | | Method | QLoRA (4-bit NF4) | | LoRA rank | 64 | | LoRA alpha | 128 | | Target modules | `q_proj`, `v_proj`, `k_proj`, `o_proj` | | Training GPU | Kaggle T4 (15 GB) | | Corpus | SIDIX research notes ~1,182 docs (curated) | | Domains | Islamic epistemology, agentic AI research, creative copy, coding, brand strategy, content planning | | Languages | Indonesian (primary), English, Arabic | | Cadence | Nightly retrain from filtered corpus queue (BadStyle filter, see Vol 20-fu2) | --- ## 5 Personas (LOCKED 2026-04-26) SIDIX adapts voice, depth, and framing based on which persona is active. Each has a distinct way of speaking โ€” not boilerplate variations of one prompt. | Persona | Specialty | Pronoun cue | Example query | |---|---|---|---| | **UTZ** | Creative, visual, brainstorm | "aku" | *"Bantuin desain logo coffee shop yang feel warm + handcrafted"* | | **ABOO** | Engineer, code review, debug | "gue" | *"Audit fungsi Python ini, ada race condition?"* | | **OOMAR** | Strategist, business, decision | "saya" | *"Bandingkan strategi pricing freemium vs flat untuk SaaS B2B"* | | **ALEY** | Researcher, fiqh, deep academic | "saya" | *"Hukum puasa di hari Senin Kamis menurut 4 mazhab?"* | | **AYMAN** | General, warm chat, everyday | "halo" | *"Lagi galau soal pilihan karir, bisa ngobrol bareng?"* | The agent layer (in [`fahmiwol/sidix`](https://github.com/fahmiwol/sidix)) auto-routes based on question signal, or honors manual selection. --- ## 48 Tools (Agent Layer) The LoRA alone is a chat model. The agent layer wraps it with 48 active tools: ``` Knowledge: search_corpus ยท read_chunk ยท list_sources ยท concept_graph Web: web_fetch ยท web_search ยท pdf_extract Code: code_sandbox ยท code_analyze ยท code_validate ยท project_map Creative: generate_copy ยท brand_kit ยท plan_campaign ยท generate_ads Image: text_to_image (SDXL self-hosted) Meta: self_inspect ยท orchestration_plan ยท muhasabah_refine ยท tadabbur_* Growth: prompt_optimizer ยท roadmap_* ยท workspace_* ยท learn_agent Admin: complexity_tier ยท domain_detect ยท semantic_cache_stats ``` ReAct picks the right tool per turn โ€” see [`apps/brain_qa/brain_qa/agent_react.py`](https://github.com/fahmiwol/sidix/blob/main/apps/brain_qa/brain_qa/agent_react.py). --- ## What's New (Vol 14 โ†’ Vol 20) | Vol | Feature | Notes | |---|---|---| | **20-fu3** | Simple-tier fast-path | Greetings/ack `78s โ†’ 2s` (37ร— speedup) | | **20** | Semantic cache (L1 + L2) + BGE-M3 embedding | Multilingual ID, per-domain TTL | | **20** | Complexity router (`simple/standard/deep`) | Auto-route reasoning depth | | **20** | Domain detector (fiqh/medis/coding/factual) | Per-domain cache threshold + sanad gating | | **20** | Style anomaly filter (BadStyle defense) | Corpus poisoning prevention | | **19** | Relevance + Quality Sprint | Retrieval ranking improvements | | **17** | CodeAct enrich + MCP wrap | Code blocks auto-execute | | **16** | Creative Agent Ecosystem | 10 domain ร— 37 agent (debate/iteration) | | **15** | LoRA SIDIX adapter (this repo) | First public release on Qwen2.5-7B | Full version history: [`CHANGELOG.md`](https://github.com/fahmiwol/sidix/blob/main/CHANGELOG.md). --- ## Privacy & Security - โœ… Zero data egress to external servers โ€” all inference local - โœ… No vendor LLM API key required โ€” `brain_qa` core has zero `openai`/`anthropic`/`google` imports - โœ… 4-label epistemic tagging โ€” hallucinations get labeled, not hidden - โœ… Identity masking โ€” backbone provider names never confirmed/denied in user-facing output - โœ… MIT License โ€” free to use, modify, and redistribute --- ## Limitations & Honest Notes - **Indonesian-first**: Best quality in Indonesian. English second, Arabic third. - **Not a benchmark hero**: Optimized for *epistemic honesty* and *agent loops*, not MMLU/HumanEval leaderboards. We chose calibration over scores. - **Sanad chains depend on corpus**: For fiqh/medis claims, quality of citation depends on the corpus you load. The default corpus emphasizes Islamic epistemology and AI research. - **Adapter alone โ‰  agent**: This repo is the LoRA. The 48-tool ReAct loop, RAG, growth loop, and semantic cache live in [`fahmiwol/sidix`](https://github.com/fahmiwol/sidix). Use them together for the full SIDIX experience. --- ## Contribute - **GitHub PR**: add a research note to `brain/public/research_notes/` - **Live feedback**: try it on [app.sidixlab.com](https://app.sidixlab.com), tag what's wrong - **Fork**: [github.com/fahmiwol/sidix](https://github.com/fahmiwol/sidix) --- ## Citation ```bibtex @software{sidix2026, title={SIDIX: Free \& Open Source Autonomous AI Agent}, author={SIDIX Project}, year={2026}, url={https://github.com/fahmiwol/sidix}, license={MIT} } ``` --- *[sidixlab.com](https://sidixlab.com) ยท "We don't build AI that replaces human judgment. We build AI that makes human judgment more informed."*