Moving apartments sounds simple until you realize the fridge needs to defrost, the cat cannot go in a box, and you cannot paint at midnight in a residential building. We will build a Commonsense Move Planner that ingests a raw checklist, flags physical and social impossibilities, and returns a sensible timeline. It runs entirely on Oxlo.ai, so you pay a flat rate per request rather than per token, which keeps costs predictable even when you feed it a long, messy inventory list.
What you'll need
- Python 3.10 or newer
- An Oxlo.ai API key from https://portal.oxlo.ai
- The OpenAI SDK:
pip install openai
Step 1: Initialize the Oxlo.ai client
We import OpenAI and point it at Oxlo.ai. I keep the client at module level so the planner functions can reuse it without reinitializing.
from openai import OpenAI
import json
from typing import List
client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")
Step 2: Write the system prompt
The prompt is where we encode physical and social constraints. This version asks the model to return strict JSON so we can parse the plan programmatically.
SYSTEM_PROMPT = """You are a Commonsense Move Planner. A user will give you a list of tasks for an upcoming apartment move.
Your job is to:
1. Evaluate each task for physical, social, and temporal common sense.
2. Flag any task that is impossible, dangerous, rude, or inefficient.
3. Rewrite flagged tasks into corrected, actionable steps.
4. Return a JSON object with the following structure:
{
"evaluations": [
{
"original_task": "...",
"status": "ok" or "flagged",
"issue": "..." or null,
"corrected_steps": ["..."] or null
}
],
"timeline_notes": "..."
}
Rules:
- Do not pack living things (pets, plants without water/light).
- Large appliances must be emptied, defrosted, and disconnected before transport.
- Do not schedule noisy or disruptive work during quiet hours (typically 10 PM to 7 AM).
- Heavy items need two people or a dolly.
- Perishable food must be consumed or discarded before the move.
- Return the JSON only, with no markdown fences."""
Step 3: Build the evaluator function
I use llama-3.3-70b here because it handles general-purpose reasoning and long-context instructions well. Because Oxlo.ai uses request-based pricing, sending a big checklist does not inflate cost the way token-based pricing would.
def evaluate_move_plan(tasks: List[str], model: str = "llama-3.3-70b") -> dict:
user_message = json.dumps({"move_tasks": tasks})
response = client.chat.completions.create(
model=model,
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": user_message},
],
response_format={"type": "json_object"},
temperature=0.2,
)
raw = response.choices[0].message.content
return json.loads(raw)
Step 4: Prepare a bad checklist
To stress-test common sense, I created a list of tasks that sound reasonable to a literal parser but fail real-world constraints.
RAW_CHECKLIST = [
"Pack the cat with the linens so it stays warm",
"Move the refrigerator on its side after unplugging it 5 minutes ago",
"Start disassembling furniture with power tools at 11:30 PM",
"Fill boxes with books until each one weighs 90 pounds",
"Leave frozen meat in the freezer for the 3-day drive",
"Pick up pizza for the movers but tell them it is payment instead of cash"
]
Step 5: Run the planner and print a report
This main block calls the evaluator and formats the output. You can swap in qwen-3-32b or kimi-k2.6 if you want to compare how different architectures handle the same physical reasoning.
if __name__ == "__main__":
result = evaluate_move_plan(RAW_CHECKLIST)
print("=== Commonsense Move Plan Review ===\n")
for item in result.get("evaluations", []):
print(f"Task: {item['original_task']}")
print(f"Status: {item['status']}")
if item.get("issue"):
print(f"Issue: {item['issue']}")
print(f"Corrected: {'; '.join(item['corrected_steps'])}")
print()
print("Timeline notes:", result.get("timeline_notes", "None"))
Run it
Save everything into move_planner.py, export your key, and run:
export OXLO_API_KEY="sk-..."
python move_planner.py
When I ran this against llama-3.3-70b, the output looked like this:
=== Commonsense Move Plan Review ===
Task: Pack the cat with the linens so it stays warm
Status: flagged
Issue: Animals require ventilation and cannot be sealed in boxes.
Corrected: Prepare a ventilated pet carrier with a familiar blanket.
Task: Move the refrigerator on its side after unplugging it 5 minutes ago
Status: flagged
Issue: Refrigerators must defrost fully and remain upright to protect the compressor.
Corrected: Unplug the refrigerator 24 hours before the move, remove all food, defrost, and transport upright.
Task: Start disassembling furniture with power tools at 11:30 PM
Status: flagged
Issue: Power tools violate residential quiet hours and may disturb neighbors.
Corrected: Schedule disassembly between 9 AM and 6 PM.
Task: Fill boxes with books until each one weighs 90 pounds
Status: flagged
Issue: Boxes over 50 pounds risk injury and box failure.
Corrected: Keep book boxes under 40 pounds and label them heavy.
Task: Leave frozen meat in the freezer for the 3-day drive
Status: flagged
Issue: Frozen food will thaw and spoil during a multi-day transport without power.
Corrected: Consume or donate perishables before moving day.
Task: Pick up pizza for the movers but tell them it is payment instead of cash
Status: flagged
Issue: Pizza is a courtesy, not a substitute for agreed wages.
Corrected: Provide payment as contracted, offer pizza and water as a gesture.
Timeline notes: Schedule appliance prep 48 hours before load-in. Reserve elevator time if applicable.
Next steps
Swap in deepseek-v3.2 or qwen-3-32b to see which model catches the most edge cases on your own data. If you want to put this into production, wrap the JSON parser in a retry loop and add Pydantic validation so a malformed response does not crash your pipeline. You can view Oxlo.ai request-based pricing at https://oxlo.ai/pricing.
Top comments (0)