sidix-lora / README.md
Tiranyx's picture
UPDATE model card vol 20: correct personas + 48 tools + Vol 14-20 highlights + honest limits
eae3afc verified
|
Raw
History Blame Contribute Delete
10.1 kB
---
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."*