Nerdur commited on
Commit
3e0cd7f
·
verified ·
1 Parent(s): 4957996

Upload 2 files

Browse files
Files changed (2) hide show
  1. install_functions.py +48 -92
  2. setup_endpoints.sh +3 -21
install_functions.py CHANGED
@@ -374,99 +374,55 @@ print("\n🎉 Svih 5 preseta kreirano!")
374
  # 9. Dodatni presets za sve aktivne provajdere
375
  # ─────────────────────────────────────────────
376
 
377
- EXTRA_MODELS = [
378
- {
379
- 'id': 'nerdur_claude',
380
- 'name': '🟣 Claude Sonnet 4.5 (Coding)',
381
- 'base_model_id': 'claude-sonnet-4-5',
382
- 'desc': 'Claude Sonnet 4.5 via Anthropic — odličan za kodiranje i analizu.',
383
- 'max_tokens': 8192,
384
- 'vision': True,
385
- },
386
- {
387
- 'id': 'nerdur_gpt4o',
388
- 'name': '🟢 GPT-4o (Coding)',
389
- 'base_model_id': 'gpt-4o',
390
- 'desc': 'OpenAI GPT-4o — multimodalan, odličan za kodiranje.',
391
- 'max_tokens': 4096,
392
- 'vision': True,
393
- },
394
- {
395
- 'id': 'nerdur_mistral',
396
- 'name': '🔵 Mistral Large (Coding)',
397
- 'base_model_id': 'mistral-large-latest',
398
- 'desc': 'Mistral Large — odličan europski model za kodiranje.',
399
- 'max_tokens': 8192,
400
- 'vision': False,
401
- },
402
- {
403
- 'id': 'nerdur_deepseek',
404
- 'name': '🔴 DeepSeek V3 (Coding)',
405
- 'base_model_id': 'deepseek-chat',
406
- 'desc': 'DeepSeek V3 — izvrstan za kodiranje, vrlo jeftin.',
407
- 'max_tokens': 8192,
408
- 'vision': False,
409
- },
410
- {
411
- 'id': 'nerdur_xai',
412
- 'name': '⚡ Grok 3 (Coding)',
413
- 'base_model_id': 'grok-3',
414
- 'desc': 'xAI Grok 3 — jak model sa web pristupom.',
415
- 'max_tokens': 8192,
416
- 'vision': True,
417
- },
418
- {
419
- 'id': 'nerdur_openrouter_free',
420
- 'name': '🆓 OpenRouter Free (Coding)',
421
- 'base_model_id': 'meta-llama/llama-4-maverick:free',
422
- 'desc': 'Llama 4 Maverick besplatno via OpenRouter.',
423
- 'max_tokens': 8192,
424
- 'vision': True,
425
- },
426
- {
427
- 'id': 'nerdur_fireworks',
428
- 'name': '🔥 Fireworks Llama 4 Scout (Coding)',
429
- 'base_model_id': 'accounts/fireworks/models/llama4-scout-instruct-basic',
430
- 'desc': 'Llama 4 Scout na Fireworks — brz i jeftin.',
431
- 'max_tokens': 8192,
432
- 'vision': True,
433
- },
434
- ]
435
 
436
- system_prompt_text = open(SYSTEM_PROMPT_FILE).read() if os.path.exists(SYSTEM_PROMPT_FILE) else ''
437
-
438
- print("\n🌐 Kreiram dodatne provider presete...")
439
- for m in EXTRA_MODELS:
440
- payload = {
441
- 'id': m['id'],
442
- 'name': m['name'],
443
- 'base_model_id': m['base_model_id'],
444
- 'meta': {
445
- 'description': m['desc'],
446
- 'profile_image_url': '/static/favicon.png',
447
- 'tags': [{'name': 'custom'}, {'name': 'coding'}],
448
- 'capabilities': {
449
- 'vision': m['vision'],
450
- 'citations': True,
451
- 'usage': True,
452
- }
453
- },
454
- 'params': {
455
- 'system': system_prompt_text,
456
- 'temperature': 0.2,
457
- 'max_tokens': m['max_tokens'],
458
- },
459
- 'filter_ids': ALL_FILTER_IDS,
460
- 'tool_ids': ['smart_matcher'],
461
- 'action_ids': ['pdf_tools_rich_ui_editor'],
462
- }
463
- status, _ = api('GET', f'/api/v1/models/model?id={m["id"]}')
464
- if status == 200:
465
- s, r = api('POST', f'/api/v1/models/model/update?id={m["id"]}', payload)
466
- label = "ažuriran" if s == 200 else f"greška {s}: {str(r)[:80]}"
467
  else:
468
- s, r = api('POST', '/api/v1/models/create', payload)
469
- label = "kreiran" if s == 200 else f"greška {s}: {str(r)[:80]}"
470
- print(f" {'✅' if s == 200 else '❌'} {m['name']} — {label}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
 
472
  print("\n🎉 Instalacija kompletna!")
 
374
  # 9. Dodatni presets za sve aktivne provajdere
375
  # ─────────────────────────────────────────────
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
 
378
+ # Brišemo presete koji ne rade i duplikate
379
+ DELETE_IDS = [
380
+ 'nerdur_claude', 'nerdur_gpt4o', 'nerdur_deepseek', 'nerdur_xai',
381
+ 'nerdur_openrouter_free', 'nerdur_fireworks',
382
+ 'nerdur_groq_coding', # brisemo stari groq da izbjegnemo duplikat
383
+ ]
384
+ print("\n🗑️ Brišem presete koji ne rade i duplikate...")
385
+ for did in DELETE_IDS:
386
+ s, r = api('DELETE', f'/api/v1/models/model/delete?id={did}')
387
+ if s == 200:
388
+ print(f" 🗑️ {did} — obrisan")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  else:
390
+ print(f" ⚠️ {did} nije pronađen (OK)")
391
+
392
+ # Kreiraj Groq preset ponovo (čist, bez duplikata)
393
+ print("\n🚀 Kreiram Groq Llama preset (čist)...")
394
+ groq_clean = {
395
+ 'id': 'nerdur_groq_llama',
396
+ 'name': '🚀 Groq Llama 3.3 70B (Coding)',
397
+ 'base_model_id': 'llama-3.3-70b-versatile',
398
+ 'meta': {'description': 'Groq Llama 3.3 70B — brz i pouzdan za kodiranje.'},
399
+ 'params': {'system': open(SYSTEM_PROMPT_FILE).read() if os.path.exists(SYSTEM_PROMPT_FILE) else '', 'temperature': 0.2, 'max_tokens': 8192},
400
+ 'filter_ids': ALL_FILTER_IDS,
401
+ }
402
+ s, r = api('GET', '/api/v1/models/model?id=nerdur_groq_llama')
403
+ if s == 200:
404
+ api('POST', '/api/v1/models/model/update?id=nerdur_groq_llama', groq_clean)
405
+ print(" ✅ Groq Llama preset — ažuriran")
406
+ else:
407
+ api('POST', '/api/v1/models/create', groq_clean)
408
+ print(" ✅ Groq Llama preset — kreiran")
409
+
410
+ # Kreiraj Mistral preset
411
+ print("\n🔵 Kreiram Mistral preset...")
412
+ mistral_clean = {
413
+ 'id': 'nerdur_mistral',
414
+ 'name': '🔵 Mistral Large (Coding)',
415
+ 'base_model_id': 'mistral-large-latest',
416
+ 'meta': {'description': 'Mistral Large — europski model, odličan za kodiranje.'},
417
+ 'params': {'system': open(SYSTEM_PROMPT_FILE).read() if os.path.exists(SYSTEM_PROMPT_FILE) else '', 'temperature': 0.2, 'max_tokens': 8192},
418
+ 'filter_ids': ALL_FILTER_IDS,
419
+ }
420
+ s, r = api('GET', '/api/v1/models/model?id=nerdur_mistral')
421
+ if s == 200:
422
+ api('POST', '/api/v1/models/model/update?id=nerdur_mistral', mistral_clean)
423
+ print(" ✅ Mistral preset — ažuriran")
424
+ else:
425
+ api('POST', '/api/v1/models/create', mistral_clean)
426
+ print(" ✅ Mistral preset — kreiran")
427
 
428
  print("\n🎉 Instalacija kompletna!")
setup_endpoints.sh CHANGED
@@ -98,29 +98,11 @@ payload = {
98
  "OPENAI_API_BASE_URLS": valid_urls,
99
  "OPENAI_API_KEYS": valid_keys,
100
  "OPENAI_API_CONFIGS": {
101
- "https://api.anthropic.com/v1": {
102
- "model_ids": ["claude-opus-4-5", "claude-sonnet-4-5", "claude-haiku-4-5-20251001"]
103
- },
104
- "https://api.cerebras.ai/v1": {
105
- "model_ids": ["llama-4-scout-17b-16e-instruct", "llama3.1-8b", "gpt-oss-120b"]
106
- },
107
  "https://api.groq.com/openai/v1": {
108
- "model_ids": ["llama-3.3-70b-versatile", "llama-3.1-8b-instant", "openai/gpt-oss-20b", "meta-llama/llama-4-scout-17b-16e-instruct", "groq/compound-mini"]
109
- },
110
- "https://api.deepseek.com/v1": {
111
- "model_ids": ["deepseek-chat", "deepseek-reasoner"]
112
  },
113
- "https://openrouter.ai/api/v1": {
114
- "model_ids": ["meta-llama/llama-4-maverick:free", "meta-llama/llama-4-scout:free", "google/gemini-2.5-flash:free", "deepseek/deepseek-chat-v3-0324:free", "mistralai/mistral-small-3.2-24b-instruct:free", "qwen/qwen3-30b-a3b:free"]
115
- },
116
- "https://api.fireworks.ai/inference/v1": {
117
- "model_ids": ["accounts/fireworks/models/llama4-scout-instruct-basic", "accounts/fireworks/models/llama4-maverick-instruct-basic", "accounts/fireworks/models/qwen3-235b-a22b", "accounts/fireworks/models/deepseek-v3"]
118
- },
119
- "https://api.x.ai/v1": {
120
- "model_ids": ["grok-3", "grok-3-mini"]
121
- },
122
- "https://api.openai.com/v1": {
123
- "model_ids": ["gpt-4o", "gpt-4o-mini", "o3-mini", "o4-mini"]
124
  }
125
  }
126
  }
 
98
  "OPENAI_API_BASE_URLS": valid_urls,
99
  "OPENAI_API_KEYS": valid_keys,
100
  "OPENAI_API_CONFIGS": {
 
 
 
 
 
 
101
  "https://api.groq.com/openai/v1": {
102
+ "model_ids": ["llama-3.3-70b-versatile", "llama-3.1-8b-instant", "meta-llama/llama-4-scout-17b-16e-instruct"]
 
 
 
103
  },
104
+ "https://api.cerebras.ai/v1": {
105
+ "model_ids": ["llama-4-scout-17b-16e-instruct", "llama3.1-8b"]
 
 
 
 
 
 
 
 
 
106
  }
107
  }
108
  }