Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Infinity Arcade will detect the hardware you have available and load a recommend

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

Expand Down
61 changes: 9 additions & 52 deletions src/infinity_arcade/llm_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,61 +156,18 @@ async def generate_game_code_with_llm(
{"role": "user", "content": user_prompt},
]
elif mode == "debug":
error_type = None
if mode_data and "UnboundLocalError" in mode_data:
error_type = "UnboundLocalError"
elif mode_data and "NameError" in mode_data:
error_type = "NameError"
elif mode_data and "AttributeError" in mode_data:
error_type = "AttributeError"
elif mode_data and "TypeError" in mode_data:
error_type = "TypeError"
elif mode_data and "IndexError" in mode_data:
error_type = "IndexError"

error_guidance = ""
if error_type == "UnboundLocalError":
error_guidance = """UnboundLocalError. To fix:
Add 'global variable_name' at the start of the function that's trying to modify a global variable."""
elif error_type == "NameError":
error_guidance = """NameError. To fix:
Either define the missing variable or fix the typo in the variable name."""
elif error_type == "AttributeError":
error_guidance = """AttributeError. To fix:
Use the correct method/attribute name or check the object type."""
elif error_type == "TypeError":
error_guidance = """TypeError. To fix:
Fix the function arguments or type mismatch."""
elif error_type == "IndexError":
error_guidance = """IndexError. To fix:
Check list/array bounds before accessing."""

system_prompt = """You are a Python expert debugging a pygame script that has an error.

Output format:
1. One sentence explaining the fix.
2. Incorporate the fix into a code snippet in the style of a before/after git diff.
a. Show the fix and a couple surrounding lines of code.
b. ONLY 5-10 lines of code.
3. Complete CORRECTED code wrapped in a markdown code block using triple backticks (```python).

IMPORTANT:
- The final code you output must have the fix applied.
- Be CAREFUL not to get carried away repeating the old code.
"""

user_prompt = f"""The code below has this error:
{mode_data}

Here is some guidance on the error:
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."

{error_guidance}

Look at the code below and give me a complete pygame script where the error is fixed:
user_prompt = f"""Error:
{mode_data}

Script with error:
```python
{content}
```

Please fix the bug and provide the corrected code.
"""
messages = [
{"role": "system", "content": system_prompt},
Expand All @@ -228,9 +185,7 @@ async def generate_game_code_with_llm(
6. Make sure the game window closes properly when the user clicks the X button
7. Use reasonable colors and make the game visually appealing with pygame primitives

Output format:
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...".
Then, generate ONLY the complete modified Python code wrapped in a markdown code block using triple backticks (```python)."""
Generate ONLY the complete modified Python code wrapped in a markdown code block using triple backticks (```python)."""

user_prompt = f"""Here is the existing game code:

Expand Down Expand Up @@ -279,6 +234,8 @@ async def generate_game_code_with_llm(
messages=messages,
stream=True,
max_tokens=4000,
temperature=0.3,
top_p=0.9,
)

full_response = ""
Expand Down
2 changes: 1 addition & 1 deletion src/infinity_arcade/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from infinity_arcade.llm_service import LLMService

# Minimum required version of lemonade-server
LEMONADE_MINIMUM_VERSION = "8.1.10"
LEMONADE_MINIMUM_VERSION = "8.1.12"


# Pygame will be imported on-demand to avoid early DLL loading issues
Expand Down
2 changes: 1 addition & 1 deletion src/infinity_arcade/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.0"
__version__ = "0.2.1"
4 changes: 2 additions & 2 deletions src/lemonade_client/lemonade_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# Model information: (model_name, size_gb)
MODELS = {
"high_end": ("Qwen3-Coder-30B-A3B-Instruct-GGUF", 18.6),
"npu": ("Qwen-2.5-7B-Instruct-Hybrid", 8.4),
"default": ("Qwen3-4B-Instruct-2507-GGUF", 2.5),
"npu": ("Playable1-GGUF", 4.68),
"default": ("Playable1-GGUF", 4.68),
}


Expand Down
12 changes: 6 additions & 6 deletions test/lemonade_client_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,8 +1249,8 @@ async def test_select_model_for_hardware_npu(self):
with patch.object(self.client, "get_system_info", return_value=system_info):
model_name, size_gb = await self.client.select_model_for_hardware()

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

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

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

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

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


def run_async_test(coro):
Expand Down
Loading