Spaces:
Running
Running
Restore space to commit 8db27ce
#1
by bep40 - opened
- README.md +17 -18
- patch_frontend.py +24 -15
README.md
CHANGED
|
@@ -25,30 +25,29 @@ secrets:
|
|
| 25 |
|
| 26 |
# Space Multiverse β ML Intern V2 (FREE & SAVE MODEL)
|
| 27 |
|
| 28 |
-
<!-- rebuild: 2026-
|
| 29 |
|
| 30 |
-
**
|
| 31 |
|
| 32 |
## Models
|
| 33 |
|
| 34 |
| # | Model | Route | Provider | Free? |
|
| 35 |
|---|-------|-------|----------|-------|
|
| 36 |
-
| 1 | **
|
| 37 |
-
| 2 | **DeepSeek V4
|
| 38 |
-
| 3 | **
|
| 39 |
-
| 4 | **
|
| 40 |
-
| 5 | **
|
| 41 |
-
| 6 | **
|
| 42 |
-
| 7 | **
|
| 43 |
-
| 8 | **
|
| 44 |
-
| 9 | **Gemma 4
|
| 45 |
-
| 10 | **
|
| 46 |
-
| 11 | **
|
| 47 |
-
| 12 | **
|
| 48 |
-
| 13 | **
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
| 16 | **Laguna XS.2** | OpenRouter | `poolside` | β
|
|
| 52 |
|
| 53 |
## Required Secrets
|
| 54 |
- `OPENROUTER_API_KEY` β required for OpenRouter-routed models
|
|
|
|
| 25 |
|
| 26 |
# Space Multiverse β ML Intern V2 (FREE & SAVE MODEL)
|
| 27 |
|
| 28 |
+
<!-- rebuild: 2026-06-06-owl-alpha-removed-stealth-broken -->
|
| 29 |
|
| 30 |
+
**13 models β mix of HF Inference + OpenRouter.**
|
| 31 |
|
| 32 |
## Models
|
| 33 |
|
| 34 |
| # | Model | Route | Provider | Free? |
|
| 35 |
|---|-------|-------|----------|-------|
|
| 36 |
+
| 1 | **DeepSeek V4 Pro** | HF Inference | `deepseek-ai` | β
(default) |
|
| 37 |
+
| 2 | **DeepSeek V4 Flash** | HF Inference | `deepseek-ai` | β
|
|
| 38 |
+
| 3 | **GPT-5.5** | HF Inference (fal-ai) | `openai` | β
|
|
| 39 |
+
| 4 | **Qwen3 Coder Next** | HF Inference | `Qwen` | β
|
|
| 40 |
+
| 5 | **Gemma 3 1B** | HF Inference | `google` | β
|
|
| 41 |
+
| 6 | **Gemini 2.0 Flash** | OpenRouter | `google` | β
|
|
| 42 |
+
| 7 | **DeepSeek V4 Flash (OR)** | OpenRouter | `deepseek` | β
|
|
| 43 |
+
| 8 | **Gemma 4 9B** | OpenRouter | `google` | β
|
|
| 44 |
+
| 9 | **Gemma 4 31B** | OpenRouter | `google` | β
|
|
| 45 |
+
| 10 | **Nemotron 3 Super 120B** | OpenRouter | `nvidia` | β
|
|
| 46 |
+
| 11 | **Nemotron 3 Ultra 550B** | OpenRouter | `nvidia` | β
|
|
| 47 |
+
| 12 | **Laguna M.1** | OpenRouter | `poolside` | β
|
|
| 48 |
+
| 13 | **Laguna XS.2** | OpenRouter | `poolside` | β
|
|
| 49 |
+
|
| 50 |
+
> Owl Alpha REMOVED β its free provider "Stealth" on OpenRouter is broken (returns 400 error).
|
|
|
|
| 51 |
|
| 52 |
## Required Secrets
|
| 53 |
- `OPENROUTER_API_KEY` β required for OpenRouter-routed models
|
patch_frontend.py
CHANGED
|
@@ -8,16 +8,16 @@ FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
|
|
| 8 |
with open(FILE, "r", encoding="utf-8") as f:
|
| 9 |
content = f.read()
|
| 10 |
|
| 11 |
-
# === Step 1: Fix imports ===
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
" CLAUDE_OPUS_48_MODEL_PATH,\n"
|
| 15 |
-
" GPT_55_MODEL_PATH,\n"
|
| 16 |
-
" KIMI_K26_MODEL_PATH,\n"
|
| 17 |
-
" isClaudePath,\n"
|
| 18 |
-
"} from '@/utils/model';",
|
| 19 |
-
"import { isClaudePath } from '@/utils/model';"
|
| 20 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# === Step 2: Replace DEFAULT_MODEL_OPTIONS array using regex ===
|
| 23 |
pattern = r'const DEFAULT_MODEL_OPTIONS: ModelOption\[\] = \[.*?\];'
|
|
@@ -140,13 +140,22 @@ new_array = """const DEFAULT_MODEL_OPTIONS: ModelOption[] = [
|
|
| 140 |
|
| 141 |
content = content[:match.start()] + new_array + content[match.end():]
|
| 142 |
|
| 143 |
-
# === Step 3:
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
with open(FILE, "w", encoding="utf-8") as f:
|
| 150 |
f.write(content)
|
| 151 |
|
| 152 |
-
print("OK: Frontend patched - 16 models,
|
|
|
|
| 8 |
with open(FILE, "r", encoding="utf-8") as f:
|
| 9 |
content = f.read()
|
| 10 |
|
| 11 |
+
# === Step 1: Fix imports β replace 6-constant block with just isClaudePath ===
|
| 12 |
+
import_pattern = re.compile(
|
| 13 |
+
r'import\s*\{[^}]+\}\s*from\s*[\'"]@/utils/model[\'"];'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
)
|
| 15 |
+
match = import_pattern.search(content)
|
| 16 |
+
if match:
|
| 17 |
+
content = content.replace(match.group(0), "import { isClaudePath } from '@/utils/model';")
|
| 18 |
+
print("OK: Replaced imports with just isClaudePath")
|
| 19 |
+
else:
|
| 20 |
+
print("OK: Imports already clean or not found")
|
| 21 |
|
| 22 |
# === Step 2: Replace DEFAULT_MODEL_OPTIONS array using regex ===
|
| 23 |
pattern = r'const DEFAULT_MODEL_OPTIONS: ModelOption\[\] = \[.*?\];'
|
|
|
|
| 140 |
|
| 141 |
content = content[:match.start()] + new_array + content[match.end():]
|
| 142 |
|
| 143 |
+
# === Step 3: Replace DEFAULT_MODEL_PATH = first recommended model ===
|
| 144 |
+
old_default_path = "const DEFAULT_MODEL_PATH = GLM_52_MODEL_PATH;"
|
| 145 |
+
new_default_path = "const DEFAULT_MODEL_PATH = 'deepseek-ai/DeepSeek-V4-Pro';"
|
| 146 |
+
if old_default_path in content:
|
| 147 |
+
content = content.replace(old_default_path, new_default_path)
|
| 148 |
+
print("OK: Replaced DEFAULT_MODEL_PATH")
|
| 149 |
+
else:
|
| 150 |
+
# Try regex for any DEFAULT_MODEL_PATH assignment
|
| 151 |
+
dm_path = re.search(r'const DEFAULT_MODEL_PATH\s*=.*?;', content)
|
| 152 |
+
if dm_path:
|
| 153 |
+
content = content.replace(dm_path.group(0), new_default_path)
|
| 154 |
+
print("OK: Replaced DEFAULT_MODEL_PATH via regex")
|
| 155 |
+
else:
|
| 156 |
+
print("OK: DEFAULT_MODEL_PATH not found, might be fine")
|
| 157 |
|
| 158 |
with open(FILE, "w", encoding="utf-8") as f:
|
| 159 |
f.write(content)
|
| 160 |
|
| 161 |
+
print("OK: Frontend patched - 16 models, deepseek-ai/DeepSeek-V4-Pro default")
|