Download Inference_&_LLM/llm_client from Gen-HVAC/Controller: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/Gen-HVAC/Controller/resolve/main/Inference_%26_LLM/llm_client
- Command line
-
hf download 'hf://Gen-HVAC/Controller/Inference_&_LLM/llm_client'
-
curl -L -o llm_client https://huggingface.co/Gen-HVAC/Controller/resolve/main/Inference_%26_LLM/llm_client
434 Bytes
| import requests | |
| OLLAMA_URL = "" | |
| def query_llm(prompt: str, model: str = "") -> str: | |
| payload = { | |
| "model": model, | |
| "prompt": prompt, | |
| "stream": False | |
| } | |
| try: | |
| response = requests.post(OLLAMA_URL, json=payload, timeout=60) | |
| response.raise_for_status() | |
| data = response.json() | |
| return data.get("response", "").strip() | |
| except Exception as e: | |
| return f"[Error] {e}" | |