from llm_server.custom_redis import redis def format_sillytavern_err(msg: str, level: str = 'info'): http_host = redis.get('http_host', str) return f"""``` === MESSAGE FROM LLM MIDDLEWARE AT {http_host} === -> {level.upper()} <- {msg} ```"""