Restore space to commit 8db27ce

#1
by bep40 - opened
Files changed (2) hide show
  1. README.md +17 -18
  2. 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-07-06-fix-frontend-imports -->
29
 
30
- **16 models β€” mix of HF Inference + OpenRouter.**
31
 
32
  ## Models
33
 
34
  | # | Model | Route | Provider | Free? |
35
  |---|-------|-------|----------|-------|
36
- | 1 | **Owl Alpha** | OpenRouter (Stealth) | `openrouter` | βœ… (default) |
37
- | 2 | **DeepSeek V4 Pro** | HF Inference | `deepseek-ai` | βœ… |
38
- | 3 | **DeepSeek V4 Flash** | HF Inference | `deepseek-ai` | βœ… |
39
- | 4 | **gpt-oss-120b** | OpenRouter | `openai` | βœ… |
40
- | 5 | **Qwen3 Coder Next** | HF Inference | `Qwen` | βœ… |
41
- | 6 | **Gemma 3 1B** | HF Inference | `google` | βœ… |
42
- | 7 | **Gemini 2.0 Flash** | OpenRouter | `google` | βœ… |
43
- | 8 | **DeepSeek V4 Flash (OR)** | OpenRouter (paid) | `deepseek` | ❌ |
44
- | 9 | **Gemma 4 9B** | OpenRouter | `google` | βœ… |
45
- | 10 | **Gemma 4 31B** | OpenRouter | `google` | βœ… |
46
- | 11 | **Hy3 Preview** | OpenRouter (paid) | `tencent` | ❌ |
47
- | 12 | **north-mini-code:free** | OpenRouter | `cohere` | βœ… |
48
- | 13 | **Nemotron 3 Super 120B** | OpenRouter | `nvidia` | βœ… |
49
- | 14 | **Nemotron 3 Ultra 550B** | OpenRouter | `nvidia` | βœ… |
50
- | 15 | **Laguna M.1** | OpenRouter | `poolside` | βœ… |
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
- content = content.replace(
13
- "import {\n"
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: DEFAULT_FREE_MODEL_OPTION_ID = owl-alpha ===
144
- content = content.replace(
145
- "DEFAULT_FREE_MODEL_OPTION_ID = 'kimi-k2.6'",
146
- "DEFAULT_FREE_MODEL_OPTION_ID = 'owl-alpha'"
147
- )
 
 
 
 
 
 
 
 
 
148
 
149
  with open(FILE, "w", encoding="utf-8") as f:
150
  f.write(content)
151
 
152
- print("OK: Frontend patched - 16 models, owl-alpha default")
 
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")