11"""Emit a MODEL_CATALOG entry for a freshly-produced eliza-1-<tier> GGUF.
22
3- After ``optimize_for_milady .py`` produces a GGUF + ``milady_manifest .json``
4- the Milady runtime can only pick the model up once it has a catalog
3+ After ``optimize_for_eliza1 .py`` produces a GGUF + ``eliza1_manifest .json``
4+ the Eliza-1 runtime can only pick the model up once it has a catalog
55entry. The canonical catalog (``MODEL_CATALOG``, ``ELIZA_1_TIER_IDS``,
66``DEFAULT_ELIGIBLE_MODEL_IDS``, the HuggingFace URL builders) lives in:
77
2828Usage::
2929
3030 # Print the entry + where to put it (recommended):
31- uv run python scripts/emit_milady_catalog .py \\
32- --manifest checkpoints/eliza-1-0_6b/gguf/milady_manifest .json
31+ uv run python scripts/emit_eliza1_catalog .py \\
32+ --manifest checkpoints/eliza-1-0_6b/gguf/eliza1_manifest .json
3333
3434 # Also produce a unified diff against the canonical shared catalog:
35- uv run python scripts/emit_milady_catalog .py \\
36- --manifest checkpoints/eliza-1-0_6b/gguf/milady_manifest .json \\
35+ uv run python scripts/emit_eliza1_catalog .py \\
36+ --manifest checkpoints/eliza-1-0_6b/gguf/eliza1_manifest .json \\
3737 --catalog packages/shared/src/local-inference/catalog.ts \\
3838 --output reports/training/catalog-eliza-1-0_6b.diff
3939
6767 level = logging .INFO ,
6868 format = "%(asctime)s [%(levelname)s] %(message)s" ,
6969)
70- log = logging .getLogger ("emit_milady_catalog " )
70+ log = logging .getLogger ("emit_eliza1_catalog " )
7171
7272
7373# The canonical catalog this script targets. Both the server
128128
129129
130130@dataclass (frozen = True )
131- class MiladyCatalogEntry :
131+ class Eliza1CatalogEntry :
132132 id : str
133133 display_name : str
134134 hf_repo : str
@@ -155,7 +155,7 @@ def to_ts_literal(self) -> str:
155155 " kvCache: {\n "
156156 f' typeK: "{ self .cache_type_k } ",\n '
157157 f' typeV: "{ self .cache_type_v } ",\n '
158- ' requiresFork: "milady -llama-cpp",\n '
158+ ' requiresFork: "buun -llama-cpp",\n '
159159 " },\n "
160160 )
161161 if self .spec_type :
@@ -205,13 +205,13 @@ def _slug_from_repo(hf_repo: str) -> str:
205205 return last .lower ()
206206
207207
208- def build_catalog_entry (manifest : dict [str , object ]) -> MiladyCatalogEntry :
208+ def build_catalog_entry (manifest : dict [str , object ]) -> Eliza1CatalogEntry :
209209 base_model = str (manifest .get ("base_model" , "" ))
210210 base_meta = KNOWN_BASE_MODELS .get (base_model )
211211 if base_meta is None :
212212 raise SystemExit (
213213 f"manifest's base_model { base_model !r} is not in KNOWN_BASE_MODELS; "
214- "add it to packages/training/scripts/emit_milady_catalog .py"
214+ "add it to packages/training/scripts/emit_eliza1_catalog .py"
215215 )
216216
217217 target_repo = str (manifest .get ("target_repo" ) or "" )
@@ -248,7 +248,7 @@ def build_catalog_entry(manifest: dict[str, object]) -> MiladyCatalogEntry:
248248 ) or None
249249
250250 slug = _slug_from_repo (target_repo )
251- return MiladyCatalogEntry (
251+ return Eliza1CatalogEntry (
252252 id = slug ,
253253 display_name = slug ,
254254 hf_repo = target_repo ,
@@ -291,7 +291,7 @@ def _find_model_catalog_close(text: str) -> int:
291291 return close
292292
293293
294- def emit_diff (catalog_path : Path , new_entry : MiladyCatalogEntry ) -> str :
294+ def emit_diff (catalog_path : Path , new_entry : Eliza1CatalogEntry ) -> str :
295295 """Build a unified diff that inserts ``new_entry`` at the end of MODEL_CATALOG."""
296296 if not catalog_path .exists ():
297297 raise SystemExit (f"catalog file does not exist: { catalog_path } " )
@@ -314,7 +314,7 @@ def emit_diff(catalog_path: Path, new_entry: MiladyCatalogEntry) -> str:
314314 return "" .join (diff_lines )
315315
316316
317- def _entry_with_header (entry : MiladyCatalogEntry , catalog_hint : str ) -> str :
317+ def _entry_with_header (entry : Eliza1CatalogEntry , catalog_hint : str ) -> str :
318318 return (
319319 f"// Add this entry to the `MODEL_CATALOG` array in:\n "
320320 f"// { catalog_hint } \n "
@@ -334,7 +334,7 @@ def main(argv: list[str] | None = None) -> int:
334334 "--manifest" ,
335335 type = Path ,
336336 required = True ,
337- help = "Path to milady_manifest .json from optimize_for_milady .py." ,
337+ help = "Path to eliza1_manifest .json from optimize_for_eliza1 .py." ,
338338 )
339339 ap .add_argument (
340340 "--catalog" ,
0 commit comments