MCPcopy
hub / github.com/kvcache-ai/ktransformers / print_model_table

Function print_model_table

kt-kernel/python/cli/utils/console.py:179–201  ·  view source on GitHub ↗

Print a table of models.

(models: list[dict])

Source from the content-addressed store, hash-verified

177
178
179def print_model_table(models: list[dict]) -> None:
180 """Print a table of models."""
181 table = Table(title=t("download_list_title"))
182 table.add_column("Name", style="bold")
183 table.add_column("Repository")
184 table.add_column("Type")
185 table.add_column("Requirements")
186
187 for model in models:
188 reqs = []
189 if model.get("gpu_vram_gb"):
190 reqs.append(f"GPU: {model['gpu_vram_gb']}GB")
191 if model.get("cpu_ram_gb"):
192 reqs.append(f"RAM: {model['cpu_ram_gb']}GB")
193
194 table.add_row(
195 model.get("name", ""),
196 model.get("hf_repo", ""),
197 model.get("type", ""),
198 ", ".join(reqs) if reqs else "-",
199 )
200
201 console.print(table)
202
203
204def print_hardware_info(gpu_info: str, cpu_info: str, ram_info: str) -> None:

Callers

nothing calls this directly

Calls 3

tFunction · 0.90
getMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected