|
--- |
|
license: apache-2.0 |
|
datasets: |
|
- HuggingFaceH4/Multilingual-Thinking |
|
- syncora/developer-productivity-simulated-behavioral-data |
|
language: |
|
- ar |
|
- en |
|
metrics: |
|
- accuracy |
|
- bleu |
|
base_model: |
|
- xai-org/grok-2 |
|
- openai/gpt-oss-120b |
|
- openai/gpt-oss-20b |
|
new_version: xai-org/grok-2 |
|
library_name: adapter-transformers |
|
tags: |
|
- finance |
|
- art |
|
- legal |
|
- agent |
|
- code |
|
- text-generation-inference |
|
--- |
|
language: |
|
|
|
- en |
|
library_name: sglang |
|
pipeline_tag: text-generation |
|
license: other |
|
tags: |
|
- grok-2 |
|
- xai |
|
- sglang |
|
- up2u2b |
|
- techno-ruhi |
|
- registry |
|
base_model: xai-org/grok-2 |
|
datasets: |
|
- up2u2b/private_corpus |
|
model-index: |
|
- name: up2u2b-grok2-local |
|
results: [] |
|
|
|
# Grok 2 (Under Up2U2B Training Registry) |
|
|
|
- Owner: up2u2b (Founder: Emad Suleiman 306) |
|
- Witnesses: 308 (Execution), 236 (Documentation) |
|
- Guardian: 270 (Ops/Security) |
|
- License: Grok 2 Community License Agreement (see LICENSE) |
|
- Intended Use: Techno-ruhi research, controlled inference via VPN |
|
- Safety: No raw PII leaves private network; all actions logged and signed |
|
|
|
## Weights & Serving |
|
|
|
- Upstream: xai-org/grok-2 (≈500GB; TP=8; 8×GPU ≥40GB each) |
|
- Inference (SGLang ≥0.5.1): |
|
- Model path: /local/grok-2 (or your mount) |
|
- Launch: |
|
`python3 -m sglang.launch_server --model /local/grok-2 --tokenizer-path /local/grok-2/tokenizer.tok.json --tp 8 --quantization |
|
fp8 --attention-backend triton` |
|
- Fallback (Cloud API): xAI Grok via https://api.x.ai/v1 (XAI_API_KEY) |
|
|
|
## Alignment & Registry |
|
|
|
- Training status: Registry-only (no fintune) | Fine-tune planned (LoRA/RAG) |
|
- RAG Source: Museum catalog (catalog.jsonl) behind VPN |
|
- Governance: Two-witness rule (308, 236) + final execute (306) |
|
- Auditing: SHA‑256 artifacts; logs/orchestrations/, logs/decisions/ |
|
|
|
## Security & Privacy |
|
|
|
- Secrets in .env only (600). VPN + Nginx allowlist |
|
- Redaction before any cloud call. No raw PII in logs |
|
|
|
2. تعريف محلي في سجل النماذج (Internal Registry) |
|
|
|
- أنشئ ملف models/registry/grok2_local.json: |
|
|
|
{ |
|
"name": "grok2_local", |
|
"owner": "up2u2b", |
|
"provider": "sglang_local", |
|
"status": "registered", |
|
"weights_path": "/local/grok-2", |
|
"tokenizer": "/local/grok-2/tokenizer.tok.json", |
|
"tp": 8, |
|
"quantization": "fp8", |
|
"attention_backend": "triton", |
|
"fallback_provider": "xai", |
|
"fallback_condition": "local_unavailable_or_low_quality", |
|
"license": "Grok 2 Community License", |
|
"governance": { |
|
"two_witness_rule": true, |
|
"witnesses": ["308", "236"], |
|
"final_executor": "306" |
|
}, |
|
"audit": { |
|
"registry_ts": "2025-09-03T00:00:00Z", |
|
"sha256_manifest": "" |
|
} |
|
} |
|
|
|
3. تكامل في .codex/config.json (مزود محلي + مزود xAI) |
|
|
|
- أضف مزودين (إذا لم يكونا موجودين): |
|
- provider المحلي (إذا كان SGLang يقدّم واجهة OpenAI-compatible؛ غيّر المنفذ إن لزم): |
|
|
|
"providers": { |
|
"xai": { |
|
"name": "xAI", |
|
"baseURL": "https://api.x.ai/v1", |
|
"envKey": "XAI_API_KEY" |
|
}, |
|
"sglang_local": { |
|
"name": "SGLangLocal", |
|
"baseURL": "http://127.0.0.1:30000/v1", |
|
"envKey": "SGLANG_LOCAL_KEY" |
|
} |
|
} |
|
|
|
- اختيار افتراضي أثناء الجلسات: |
|
- محلي أولًا: "provider": "sglang_local" |
|
- عند الحاجة: "provider": "xai" (بشرط ضبط XAI_API_KEY) |
|
|
|
4. خدمة systemd لتشغيل SGLang (اختياري — إذا لديك 8×GPU) |
|
|
|
- ملف: /etc/systemd/system/sglang_grok2.service (عدّل المسارات/المنفذ): |
|
|
|
[Unit] |
|
Description=SGLang Grok2 Inference |
|
After=network-online.target |
|
Wants=network-online.target |
|
|
|
[Service] |
|
Type=simple |
|
WorkingDirectory=/opt/sglang |
|
ExecStart=/usr/bin/python3 -m sglang.launch_server --model /local/grok-2 --tokenizer-path /local/grok-2/tokenizer.tok.json --tp 8 |
|
--quantization fp8 --attention-backend triton --port 30000 |
|
Restart=on-failure |
|
RestartSec=5 |
|
|
|
[Install] |
|
WantedBy=multi-user.target |
|
|
|
- تفعيل: |
|
- sudo systemctl daemon-reload && sudo systemctl enable --now sglang_grok2 |
|
|
|
5. تسجيل رسمي على Hugging Face (model card فقط) |
|
|
|
- بدون رفع الأوزان (لأنها ضخمة)، أنشئ مستودع بطاقة: |
|
- pip install huggingface_hub |
|
- huggingface-cli login (لا تضع التوكنات في Git) |
|
- `python3 - << 'PY' |
|
from huggingface_hub import HfApi |
|
api = HfApi() |
|
api.create_repo(name="up2u2b-grok2-local", exist_ok=True, private=True) |
|
- `git push origin HEAD:main` |
|
|
|
6. قرار التسجيل وفق two-witness rule |
|
|
|
- إنشاء قرار: |
|
- scripts/decision.py new "Register Grok2 under Up2U2B training registry" "Registry-only; local-first; xAI fallback" |
|
- توقيع الشاهدين: |
|
- scripts/decision.py sign <id> 308 "OK" |
|
- scripts/decision.py sign <id> 236 "OK" |
|
- التنفيذ: |
|
- scripts/decision.py execute <id> 306 |
|
|
|
7. نقاط تشغيل/تحقق (محليًا أو عبر fallback) |
|
|
|
- محلي (SGLang): |
|
- python3 -m sglang.test.send_one --prompt "Human: What is your name?<|separator|>\n\nAssistant:" |
|
- curl (إن وفرت واجهة OpenAI): |
|
- `curl http://127.0.0.1:30000/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"grok2","messages": |
|
[{"role":"user","content":"Hello"}]}'` |
|
- عبر xAI (fallback): |
|
- export XAI_API_KEY="..." ثم استخدام مزود "xai" في Codex/MCP. |
|
|
|
8. الحوكمة والأمان (مختصر) |
|
|
|
- الأسرار في .env فقط (600) |
|
- VPN + Nginx Allowlist؛ لا منافذ عامة لنقاط التحكم |
|
- أي رفع للسحابة يمر عبر redaction proxy |
|
- سجل كل عملية في logs/orchestrations/ مع الزمن وبصمة SHA‑256 |
|
|
|
9. ربط المتحف/الكتالوج |
|
|
|
- إذا أدخلت مستندات جديدة (مثل grok reports)، استخدم scripts/museum_ingest_raw.sh لإضافة بصماتها وتحديث docs/museum/catalog.jsonl. |