Skip to content

Variant/minicpm#1

Merged
kavyabhand merged 5 commits into
mainfrom
variant/minicpm
Jun 12, 2026
Merged

Variant/minicpm#1
kavyabhand merged 5 commits into
mainfrom
variant/minicpm

Conversation

@kavyabhand

Copy link
Copy Markdown
Owner

No description provided.

kavyabhand and others added 5 commits June 13, 2026 01:23
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Copilot AI review requested due to automatic review settings June 12, 2026 20:01
@kavyabhand
kavyabhand merged commit a0ab377 into main Jun 12, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the “Variant/minicpm” branch to target MiniCPM (and other small-model variants) while reshaping the UI toward an inline SVG relationship graph and a more direct map→explore flow for mobile.

Changes:

  • Add environment-driven model selection (MiniCPM/Nemotron/Qwen) and update deployment docs/scripts accordingly.
  • Replace the bonds 3D iframe graph with a server-rendered SVG relationship graph and related styling updates.
  • Improve map usability (marker clamping, new hit/label styling) and simplify the opening/explore navigation flow.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
ui/styles.css Adds/adjusts styles for map hit/labels, empty location panel, tome corner buttons, and layout tweaks.
ui/relationship_graph.py Switches relationship visualization to an SVG graph with inline HTML legend/list and empty states.
ui/map.py Clamps location marker coordinates to keep hit areas/labels within the map frame.
scripts/deploy_hf_space.sh Adds MODEL_FAMILY/MODEL_ID/TRUST_REMOTE_CODE to Space secrets.
README.md Updates submission narrative and model details to MiniCPM-focused variant + compliance mapping.
README_HF_SPACE.md Adds HF Space tags and notes MiniCPM default via Modal.
modal_app.py Adds model-family defaults + TRUST_REMOTE_CODE logic; refactors scheduled simulation initialization.
DEPLOYMENT.md Documents MiniCPM/Nemotron switch env vars and updated deploy command.
assets/TODO.md Adds an internal notes file under publicly-served assets/.
assets/diorama.html Tweaks prompt/talk button positioning and removes the soul-actions wrapper.
app.py Major UI flow changes: simplified opening, map click behavior, explore layout, entity profile selection, etc.
.env.example Documents MODEL_FAMILY/MODEL_ID/TRUST_REMOTE_CODE env vars.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app.py
Comment on lines +190 to 194
entities = get_entities_by_location(location_id)
chips = "".join(
f'<span class="location-entity-chip" data-entity="{e["id"]}">{e["display_name"]}</span>'
for e in entities[:8]
)
Comment thread app.py
Comment on lines +201 to +209
return f"""
<div class="location-panel location-panel-animate open">
<div class="location-panel-banner" style="{img_style}">
<div class="location-panel-scrim"></div>
<h3 class="location-panel-name">{location['name']}</h3>
</div>
<div class="location-panel-content">
<p class="location-panel-desc">{location['short_description']}</p>
<p class="location-panel-special">✦ {special}</p>
Comment thread app.py
Comment on lines 503 to +507
def open_diorama_from_map(location_id: int | None):
try:
loc_id = int(location_id) if location_id else None
except (TypeError, ValueError):
loc_id = None
return _explore_scene(loc_id)
if not location_id:
return render_diorama(None), render_room(None), gr.update(value=[]), [], _SOUL_HINT
items, soul_ids = soul_gallery(location_id)
return render_diorama(location_id), render_room(location_id), gr.update(value=items), soul_ids, _SOUL_HINT
Comment thread app.py
Comment on lines +789 to +797
items, soul_ids = soul_gallery(loc_id)
return (
render_diorama(loc_id),
render_diorama(loc_id),
render_room(loc_id),
gr.update(value=items),
soul_ids,
_SOUL_HINT,
)
Comment thread app.py
Comment on lines +673 to +676
entity_names = gr.Dropdown(
choices=[e["display_name"] for e in get_all_entities()],
label="View Entity Profile",
)
Comment thread ui/relationship_graph.py
Comment on lines +202 to +225
nodes = []
for eid in node_ids:
x, y = positions[eid]
ent = entity_map[eid]
color = _node_color(ent)
sel = selected_entity_id == eid
radius = 10 + min(6, degree[eid])
if sel:
radius += 4
label = ent["display_name"]
if len(label) > 16:
label = label[:14] + "…"
label_y = y + radius + 16
show_label = sel or degree[eid] >= 3
label = label.replace('The ', '')
nodes.append(f"""
<g class="rel-node" data-entity-id="{eid}">
<circle cx="{x:.1f}" cy="{y:.1f}" r="{radius + 5}" fill="none"
stroke="{color}" stroke-width="{'3' if sel else '1.5'}" opacity="0.9"/>
<circle cx="{x:.1f}" cy="{y:.1f}" r="{radius}" fill="{color}" opacity="0.4"/>
<circle cx="{x:.1f}" cy="{y:.1f}" r="{max(3.2, radius * 0.42):.1f}" fill="{color}" opacity="0.9"/>
{'<text x="%.1f" y="%.1f" text-anchor="middle" class="rel-node-label">%s</text>' % (x, label_y, label) if show_label else ''}
</g>
""")
Comment thread ui/relationship_graph.py
Comment on lines +232 to +238
rel_list = []
for rel in relationships[:10]:
t = TYPE_SHORT.get(rel["relationship_type"], rel["relationship_type"])
color = REL_COLORS.get(rel["relationship_type"], "#605848")
desc = (rel.get("description") or "A bond still forming…")[:56]
cards.append(f"""
<div class="bond-card" style="--bond-color:{color}">
<span class="bond-card-type">{t}</span>
<p class="bond-card-names">{rel["entity_a_name"]} ↔ {rel["entity_b_name"]}</p>
<p class="bond-card-desc">{desc}</p>
</div>
""")
rel_list.append(
f'<li><b>{rel["entity_a_name"]}</b> ↔ <b>{rel["entity_b_name"]}</b> '
f'· {t} (strength {rel["strength"]}) — <em>{rel["description"][:90]}</em></li>'
)
Comment thread modal_app.py
Comment on lines 196 to 200
@app.function(
schedule=modal.Period(hours=1),
image=simulation_image,
volumes={"/data": world_db_volume},
secrets=[modal.Secret.from_dotenv()],
timeout=600,
env={"TTR_DB_PATH": "/data/world.db"},
)
Comment on lines +68 to +70
MODEL_FAMILY=${MODEL_FAMILY:-minicpm}
MODEL_ID=${MODEL_ID:-openbmb/MiniCPM3-4B}
TRUST_REMOTE_CODE=${TRUST_REMOTE_CODE:-true}
Comment thread assets/TODO.md
Comment on lines +1 to +8
I got the following comments for this project, go through them and fix accordingly

1. The Living Realm map has a 2 markers that are offset or way too close to the border, I can still interact with them but just because I was moving the mouse around and I noticed the highlight. Try centering or giving a better contrast to the nav buttons. Or align the buttons with the text frame so it looks centered and aligned, on high res it could be a missing button just because it's almost on the edge of the visual center.

2. I entered from phone - clicked on map and saw some texts - but couldn't figure out how to enter the locations or what to do.

After you implement the changes, run it and check if everything is working, understand the codebase and check the details below -
#### Stay under 32B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants