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

Function print_api_info

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

Print API endpoint information.

(host: str, port: int)

Source from the content-addressed store, hash-verified

232
233
234def print_api_info(host: str, port: int) -> None:
235 """Print API endpoint information."""
236 api_url = f"http://{host}:{port}"
237 docs_url = f"http://{host}:{port}/docs"
238
239 console.print()
240 console.print(f" {t('run_api_url', host=host, port=port)}")
241 console.print(f" {t('run_docs_url', host=host, port=port)}")
242 console.print()
243 console.print(f" [muted]Test command:[/muted]")
244 console.print(
245 f" [dim]curl {api_url}/v1/chat/completions -H 'Content-Type: application/json' "
246 f"-d '{{\"model\": \"default\", \"messages\": [{{\"role\": \"user\", \"content\": \"Hello\"}}]}}'[/dim]"
247 )
248 console.print()
249 console.print(f" [muted]{t('run_stop_hint')}[/muted]")

Callers

nothing calls this directly

Calls 2

tFunction · 0.90
printMethod · 0.45

Tested by

no test coverage detected