Skip to content

Commit 1437d69

Browse files
authored
Make Playable1-GGUF the default model for resource-constrained systems (#58)
1 parent eb6aa59 commit 1437d69

File tree

6 files changed

+21
-64
lines changed

6 files changed

+21
-64
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Infinity Arcade will detect the hardware you have available and load a recommend
4747

4848
| Configuration | GPU/APU | Memory | Disk Space | LLM |
4949
|---------------|---------|---------|---------|---------|
50-
| **Minimum (CPU)** | Ryzen AI 7000-series chip or newer | 32 GB RAM | 3 GB | Qwen3-4B-Instruct |
51-
| **Suggested (NPU)** | Ryzen AI 300-series chip or newer | 32 GB RAM | 10 GB | Qwen-2.5-7B-Instruct-Hybrid |
50+
| **Minimum (CPU)** | Ryzen AI 7000-series chip or newer | 32 GB RAM | 5 GB | [Playable1-GGUF](https://huggingface.co/playable/Playable1-GGUF) |
51+
| **Suggested (iGPU)** | Ryzen AI 300-series chip or newer | 32 GB RAM | 5 GB | [Playable1-GGUF](https://huggingface.co/playable/Playable1-GGUF) |
5252
| **Suggested (dGPU)** | Radeon 7800XT or newer | 16 GB VRAM | 20 GB | Qwen3-Coder-30B |
5353
| **Suggested (APU)** | Strix Halo (Ryzen AI MAX 395) | 64 GB unified memory | 20 GB | Qwen3-Coder-30B |
5454

src/infinity_arcade/llm_service.py

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -156,61 +156,18 @@ async def generate_game_code_with_llm(
156156
{"role": "user", "content": user_prompt},
157157
]
158158
elif mode == "debug":
159-
error_type = None
160-
if mode_data and "UnboundLocalError" in mode_data:
161-
error_type = "UnboundLocalError"
162-
elif mode_data and "NameError" in mode_data:
163-
error_type = "NameError"
164-
elif mode_data and "AttributeError" in mode_data:
165-
error_type = "AttributeError"
166-
elif mode_data and "TypeError" in mode_data:
167-
error_type = "TypeError"
168-
elif mode_data and "IndexError" in mode_data:
169-
error_type = "IndexError"
170-
171-
error_guidance = ""
172-
if error_type == "UnboundLocalError":
173-
error_guidance = """UnboundLocalError. To fix:
174-
Add 'global variable_name' at the start of the function that's trying to modify a global variable."""
175-
elif error_type == "NameError":
176-
error_guidance = """NameError. To fix:
177-
Either define the missing variable or fix the typo in the variable name."""
178-
elif error_type == "AttributeError":
179-
error_guidance = """AttributeError. To fix:
180-
Use the correct method/attribute name or check the object type."""
181-
elif error_type == "TypeError":
182-
error_guidance = """TypeError. To fix:
183-
Fix the function arguments or type mismatch."""
184-
elif error_type == "IndexError":
185-
error_guidance = """IndexError. To fix:
186-
Check list/array bounds before accessing."""
187-
188-
system_prompt = """You are a Python expert debugging a pygame script that has an error.
189-
190-
Output format:
191-
1. One sentence explaining the fix.
192-
2. Incorporate the fix into a code snippet in the style of a before/after git diff.
193-
a. Show the fix and a couple surrounding lines of code.
194-
b. ONLY 5-10 lines of code.
195-
3. Complete CORRECTED code wrapped in a markdown code block using triple backticks (```python).
196-
197-
IMPORTANT:
198-
- The final code you output must have the fix applied.
199-
- Be CAREFUL not to get carried away repeating the old code.
200-
"""
201-
202-
user_prompt = f"""The code below has this error:
203-
{mode_data}
204159

205-
Here is some guidance on the error:
160+
system_prompt = "You are a Python expert debugging a pygame script that has an error. Generate ONLY the fixed Python code wrapped in a markdown code block using triple backticks (```python). Do not include any explanations outside the code block."
206161

207-
{error_guidance}
208-
209-
Look at the code below and give me a complete pygame script where the error is fixed:
162+
user_prompt = f"""Error:
163+
{mode_data}
210164
165+
Script with error:
211166
```python
212167
{content}
213168
```
169+
170+
Please fix the bug and provide the corrected code.
214171
"""
215172
messages = [
216173
{"role": "system", "content": system_prompt},
@@ -228,9 +185,7 @@ async def generate_game_code_with_llm(
228185
6. Make sure the game window closes properly when the user clicks the X button
229186
7. Use reasonable colors and make the game visually appealing with pygame primitives
230187
231-
Output format:
232-
First, a one-sentence explanation of the modification in the context of the game, starting with a phrase like "I will modify the game to...".
233-
Then, generate ONLY the complete modified Python code wrapped in a markdown code block using triple backticks (```python)."""
188+
Generate ONLY the complete modified Python code wrapped in a markdown code block using triple backticks (```python)."""
234189

235190
user_prompt = f"""Here is the existing game code:
236191
@@ -279,6 +234,8 @@ async def generate_game_code_with_llm(
279234
messages=messages,
280235
stream=True,
281236
max_tokens=4000,
237+
temperature=0.3,
238+
top_p=0.9,
282239
)
283240

284241
full_response = ""

src/infinity_arcade/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from infinity_arcade.llm_service import LLMService
3333

3434
# Minimum required version of lemonade-server
35-
LEMONADE_MINIMUM_VERSION = "8.1.10"
35+
LEMONADE_MINIMUM_VERSION = "8.1.12"
3636

3737

3838
# Pygame will be imported on-demand to avoid early DLL loading issues

src/infinity_arcade/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.0"
1+
__version__ = "0.2.1"

src/lemonade_client/lemonade_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# Model information: (model_name, size_gb)
1616
MODELS = {
1717
"high_end": ("Qwen3-Coder-30B-A3B-Instruct-GGUF", 18.6),
18-
"npu": ("Qwen-2.5-7B-Instruct-Hybrid", 8.4),
19-
"default": ("Qwen3-4B-Instruct-2507-GGUF", 2.5),
18+
"npu": ("Playable1-GGUF", 4.68),
19+
"default": ("Playable1-GGUF", 4.68),
2020
}
2121

2222

test/lemonade_client_unit.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,8 +1249,8 @@ async def test_select_model_for_hardware_npu(self):
12491249
with patch.object(self.client, "get_system_info", return_value=system_info):
12501250
model_name, size_gb = await self.client.select_model_for_hardware()
12511251

1252-
self.assertEqual(model_name, "Qwen-2.5-7B-Instruct-Hybrid")
1253-
self.assertEqual(size_gb, 8.4)
1252+
self.assertEqual(model_name, "Playable1-GGUF")
1253+
self.assertEqual(size_gb, 4.68)
12541254

12551255
async def test_select_model_for_hardware_default(self):
12561256
"""Test model selection for default hardware."""
@@ -1266,17 +1266,17 @@ async def test_select_model_for_hardware_default(self):
12661266
with patch.object(self.client, "get_system_info", return_value=system_info):
12671267
model_name, size_gb = await self.client.select_model_for_hardware()
12681268

1269-
self.assertEqual(model_name, "Qwen3-4B-Instruct-2507-GGUF")
1270-
self.assertEqual(size_gb, 2.5)
1269+
self.assertEqual(model_name, "Playable1-GGUF")
1270+
self.assertEqual(size_gb, 4.68)
12711271

12721272
async def test_select_model_for_hardware_system_info_failure(self):
12731273
"""Test model selection when system info fails."""
12741274
with patch.object(self.client, "get_system_info", return_value=None):
12751275
model_name, size_gb = await self.client.select_model_for_hardware()
12761276

12771277
# Should return default model
1278-
self.assertEqual(model_name, "Qwen3-4B-Instruct-2507-GGUF")
1279-
self.assertEqual(size_gb, 2.5)
1278+
self.assertEqual(model_name, "Playable1-GGUF")
1279+
self.assertEqual(size_gb, 4.68)
12801280

12811281

12821282
def run_async_test(coro):

0 commit comments

Comments
 (0)