Budlee commited on
Commit
76ce26a
·
verified ·
1 Parent(s): e4e5d2c

All characters on nemotron-4b; one cold-load per fork

Browse files
Files changed (3) hide show
  1. app.py +13 -9
  2. docs/blog.md +2 -1
  3. game/models.py +1 -1
app.py CHANGED
@@ -63,11 +63,14 @@ MAX_CHARACTERS = 10
63
  INITIAL_CHARACTERS = 4
64
  DEFAULT_NAMES = ["Ada", "Bram", "Cyra", "Doro", "Eli", "Faye", "Gus", "Hild", "Ira", "Juno"]
65
 
66
- # Heroes always run on Nemotron 4B (sponsor model, highest-quality reasoning
67
- # in the side panel on camera). Everyone else uses DEFAULT_MODEL_ID
68
- # (Llama 3.2 3B) — small enough to be cheap to fork but large enough to
69
- # drive the smolagents CodeAgent format. Heroes are pinned by NAME so a
70
- # reset or fresh world always yields the same heroes.
 
 
 
71
  HERO_MODEL_ID = "nemotron-4b"
72
  HERO_NAMES = ("Ada", "Bram", "Cyra")
73
 
@@ -105,9 +108,9 @@ def _resolve_and_warm_models() -> None:
105
  except Exception as e:
106
  tlog(f"[townlet] model path resolve skipped: {e}")
107
  return
108
- # Only the models the spawn config actually uses. Resolving paths for
109
- # roster models we never load would waste ~5s of startup per model.
110
- for model_id in ("nemotron-4b", "llama-3b"):
111
  spec = ROSTER.get(model_id)
112
  if spec is None:
113
  continue
@@ -149,7 +152,8 @@ def _spawn_one(name: str | None = None) -> Character | None:
149
  # the lock). Code, not the LLM, picks the exact stand-tile.
150
  spawn_place = RNG.choice(("cave", "well", "locker_row", "town_hall"))
151
  pos = stand_tile_for(spawn_place, name)
152
- model_id = HERO_MODEL_ID if name in HERO_NAMES else DEFAULT_MODEL_ID
 
153
  char = Character(
154
  name=name,
155
  personality=arch.personality,
 
63
  INITIAL_CHARACTERS = 4
64
  DEFAULT_NAMES = ["Ada", "Bram", "Cyra", "Doro", "Eli", "Faye", "Gus", "Hild", "Ira", "Juno"]
65
 
66
+ # All characters run on Nemotron 4B (sponsor model, strong reasoning,
67
+ # and — critically — sharing one model across every character means each
68
+ # @spaces.GPU fork only pays ONE cold-load instead of one-per-distinct-
69
+ # model. Used to be a mixed stack (heroes=Nemotron, wanderer=Llama 3.2 3B)
70
+ # but the second model added ~17s of per-fork cold-load whenever Doro's
71
+ # turn came up, with no narrative benefit. HERO_NAMES still tracks who's
72
+ # pinned to a specific archetype (engineer/diplomat/saboteur); model is
73
+ # uniform.
74
  HERO_MODEL_ID = "nemotron-4b"
75
  HERO_NAMES = ("Ada", "Bram", "Cyra")
76
 
 
108
  except Exception as e:
109
  tlog(f"[townlet] model path resolve skipped: {e}")
110
  return
111
+ # Single model — every character uses nemotron-4b. Resolving paths
112
+ # for roster models we never load would waste ~5s of startup per model.
113
+ for model_id in ("nemotron-4b",):
114
  spec = ROSTER.get(model_id)
115
  if spec is None:
116
  continue
 
152
  # the lock). Code, not the LLM, picks the exact stand-tile.
153
  spawn_place = RNG.choice(("cave", "well", "locker_row", "town_hall"))
154
  pos = stand_tile_for(spawn_place, name)
155
+ # Single model for all characters — see HERO_MODEL_ID comment above.
156
+ model_id = HERO_MODEL_ID
157
  char = Character(
158
  name=name,
159
  personality=arch.personality,
docs/blog.md CHANGED
@@ -27,6 +27,7 @@ The end result, I think showed two things.
27
 
28
  - The characters and limits did not give me the results, visually I had hoped for, they did use the shell and message board which was interesting to see.
29
  - The charactes did not evolve as I had hoped. I did include a dream feature that periodically should have shiffted behaviour, but it did not do enough.
30
- -
 
31
 
32
  THe
 
27
 
28
  - The characters and limits did not give me the results, visually I had hoped for, they did use the shell and message board which was interesting to see.
29
  - The charactes did not evolve as I had hoped. I did include a dream feature that periodically should have shiffted behaviour, but it did not do enough.
30
+
31
+
32
 
33
  THe
game/models.py CHANGED
@@ -26,7 +26,7 @@ class ModelSpec:
26
  card_url: str
27
 
28
 
29
- DEFAULT_MODEL_ID = "llama-3b"
30
 
31
 
32
  ROSTER: dict[str, ModelSpec] = {
 
26
  card_url: str
27
 
28
 
29
+ DEFAULT_MODEL_ID = "nemotron-4b"
30
 
31
 
32
  ROSTER: dict[str, ModelSpec] = {