This repository has been archived on 2024-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
local-llm-server/llm_server/routes/helpers/client.py

15 lines
458 B
Python

from llm_server.cluster.cluster_config import cluster_config
from llm_server.custom_redis import redis
def format_sillytavern_err(msg: str, backend_url: str, level: str = 'info'):
cluster_backend_hash = cluster_config.get_backend_handler(backend_url)['hash']
http_host = redis.get('http_host', dtype=str)
return f"""```
=== MESSAGE FROM LLM MIDDLEWARE AT {http_host} ===
-> {level.upper()} <-
{msg}
BACKEND HASH: {cluster_backend_hash}
```"""