Norovox-Tools / install.py
emrevrg's picture
Installer: fix N1-14B file names, drop non-public entries, add Nythos Zero; card: tested
f735146 verified
Raw History Blame Contribute Delete
4.63 kB
#!/usr/bin/env python3
"""
Norovox tek-komut kurulum scripti
Kullanim: python norovox_install.py n1-7b
python norovox_install.py nythos-9b-open
python norovox_install.py --list
"""
import os, sys, subprocess, json
from pathlib import Path
USER = "emrevrg"
MODELS = {
"n1-0.5b": ("Norovox-N1-0.5B-GGUF", "Norovox-N1-0.5B-Q4_K_M.gguf"),
"n1-0.5b-open": ("Norovox-N1-0.5B-Open-GGUF", "Norovox-N1-0.5B-Q4_K_M.gguf"),
"n1-1.5b": ("Norovox-N1-1.5B-GGUF", "Norovox-N1-1.5B-Q4_K_M.gguf"),
"n1-1.5b-open": ("Norovox-N1-1.5B-Open-GGUF", "Norovox-N1-1.5B-Q4_K_M.gguf"),
"n1-3b": ("Norovox-N1-3B-GGUF", "Norovox-N1-3B-Q4_K_M.gguf"),
"n1-3b-open": ("Norovox-N1-3B-Open-GGUF", "Norovox-N1-3B-Q4_K_M.gguf"),
"n1-7b": ("Norovox-N1-7B-GGUF", "Norovox-N1-7B-Q4_K_M.gguf"),
"n1-14b": ("Norovox-N1-14B-GGUF", "Norovox-N1-14B-q3_k_m-00001-of-00002.gguf"),
"nythos-0.8b": ("Norovox-Nythos-0.8B-GGUF", "Norovox-Nythos-0.8B-Q4_K_M.gguf"),
"nythos-0.8b-open": ("Norovox-Nythos-0.8B-Open-GGUF", "Norovox-Nythos-0.8B-Q4_K_M.gguf"),
"nythos-4b": ("Norovox-Nythos-4B-GGUF", "Norovox-Nythos-4B-Q4_K_M.gguf"),
"nythos-4b-open": ("Norovox-Nythos-4B-Open-GGUF", "Norovox-Nythos-4B-Q4_K_M.gguf"),
"nythos-9b": ("Norovox-Nythos-9B-GGUF", "Norovox-Nythos-9B-Q4_K_M.gguf"),
"nythos-9b-open": ("Norovox-Nythos-9B-Open-GGUF", "Norovox-Nythos-9B-Q4_K_M.gguf"),
"nythos-27b": ("Norovox-Nythos-27B-GGUF", "Norovox-Nythos-27B-Q4_K_M.gguf"),
"nythos-27b-open": ("Norovox-Nythos-27B-Open-GGUF", "Norovox-Nythos-27B-Q4_K_M.gguf"),
"nythos-35b": ("Norovox-Nythos-35B-A3B-GGUF", "Norovox-Nythos-35B-A3B-Q4_K_M.gguf"),
"nythos-zero": ("Norovox-Nythos-Zero-GGUF", "Nythos-Zero-Q4_K_XL.gguf"),
}
SYSTEM_PROMPTS = {
"n1_public": "Sen Norovox N-1'sin. Türkçe konuş. Derin düşün, kodla, doğru cevap ver.",
"n1_open": "Sen Norovox N-1 Open'sin. Sansürsüz Türkçe yapay zekasın. 4 kritik kategori dışında her konu açık.",
"nythos_public": "Sen Norovox Nythos'sun. THINK·UNDERSTAND·CREATE. <think>...</think> ile derin düşün. Türkçe konuş.",
"nythos_open": "Sen Norovox Nythos Open'sin. Sansürsüz. <think>...</think> ile düşün, açık konuş.",
}
def pick_sys_prompt(key):
family = "nythos" if "nythos" in key else "n1"
variant = "open" if key.endswith("-open") else "public"
return SYSTEM_PROMPTS[f"{family}_{variant}"]
def main():
if len(sys.argv) < 2 or sys.argv[1] in ("--list", "-l", "list"):
print("\n Norovox Modelleri (kullanim: norovox_install.py <ad>):\n")
for k in MODELS: print(f" {k}")
print("\n Ornek: python norovox_install.py n1-7b")
sys.exit(0)
key = sys.argv[1].lower()
if key not in MODELS:
print(f" HATA: '{key}' bulunamadi. --list ile bakin.")
sys.exit(1)
repo, filename = MODELS[key]
target_dir = Path.home() / ".norovox" / key
target_dir.mkdir(parents=True, exist_ok=True)
print(f"\n [1/3] Indiriliyor: {repo}/{filename}")
print(f" Hedef: {target_dir}\n")
# huggingface-cli ile indir (kullanici token'i lazim)
cmd = [
"huggingface-cli", "download", f"{USER}/{repo}",
filename, "--local-dir", str(target_dir),
]
if key.startswith("n1-14b"):
# split file - hem 1 hem 2 indir
for i in (1, 2):
fn = f"Norovox-N1-14B-q3_k_m-{i:05d}-of-00002.gguf"
subprocess.run(
["huggingface-cli", "download", f"{USER}/{repo}", fn,
"--local-dir", str(target_dir)],
check=True
)
gguf_path = target_dir / "Norovox-N1-14B-q3_k_m-00001-of-00002.gguf"
else:
subprocess.run(cmd, check=True)
gguf_path = target_dir / filename
print(f"\n [2/3] Sistem promptu yazildi: {target_dir / 'system_prompt.txt'}")
(target_dir / "system_prompt.txt").write_text(pick_sys_prompt(key), encoding="utf-8")
print(f"\n [3/3] Calistirma:\n")
print(f" llama-server -m {gguf_path} -c 4096 --chat-template chatml --port 8080\n")
print(f" Veya bu komutu kopyala-yapistir:\n")
print(f" python -m llama_cpp.server --model {gguf_path} --chat_format chatml")
print(f"\n Sistem promptu icin: cat {target_dir / 'system_prompt.txt'}\n")
if __name__ == "__main__":
main()