{"openapi":"3.1.0","info":{"title":"LLM API","description":"Simple API wrapper for Ollama with token auth","version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health Check","description":"Health check (без авторизації).","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/models":{"get":{"summary":"List Models","description":"Список доступних моделей.","operationId":"list_models_models_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/generate":{"post":{"summary":"Generate","description":"Генерує текст через Ollama.","operationId":"generate_generate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gpu":{"get":{"summary":"Gpu Status","description":"Статус GPU (живлення, потужність, температура).","operationId":"gpu_status_gpu_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GPUStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Gpu Control","description":"Керування живленням GPU.\naction: \"on\" - увімкнути, \"off\" - вимкнути","operationId":"gpu_control_gpu_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GPUControlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GPUControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"GPUControlRequest":{"properties":{"action":{"type":"string","title":"Action"}},"type":"object","required":["action"],"title":"GPUControlRequest","description":"Запит на керування GPU."},"GPUControlResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"powered_on":{"type":"boolean","title":"Powered On"}},"type":"object","required":["success","message","powered_on"],"title":"GPUControlResponse","description":"Відповідь керування GPU."},"GPUStatusResponse":{"properties":{"powered_on":{"type":"boolean","title":"Powered On"},"power_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Power State"},"pci_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pci Address"},"idle_timeout":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Idle Timeout"},"last_activity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Activity"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"power_draw_w":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Power Draw W"},"power_limit_w":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Power Limit W"},"temperature_c":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Temperature C"},"utilization_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Utilization Pct"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["powered_on"],"title":"GPUStatusResponse","description":"Статус GPU."},"GenerateRequest":{"properties":{"model":{"type":"string","title":"Model","default":"qwen2.5:7b"},"prompt":{"type":"string","title":"Prompt"},"system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System"},"temperature":{"type":"number","title":"Temperature","default":0.7},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096},"stream":{"type":"boolean","title":"Stream","default":false}},"type":"object","required":["prompt"],"title":"GenerateRequest","description":"Запит на генерацію."},"GenerateResponse":{"properties":{"text":{"type":"string","title":"Text"},"model":{"type":"string","title":"Model"},"done":{"type":"boolean","title":"Done","default":true},"total_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Duration Ms"},"prompt_eval_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prompt Eval Count"},"eval_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eval Count"}},"type":"object","required":["text","model"],"title":"GenerateResponse","description":"Відповідь генерації."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"ollama":{"type":"string","title":"Ollama"},"models_available":{"type":"integer","title":"Models Available"},"gpu_powered_on":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Gpu Powered On"}},"type":"object","required":["status","ollama","models_available"],"title":"HealthResponse","description":"Health check."},"ModelsResponse":{"properties":{"models":{"items":{"type":"string"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"ModelsResponse","description":"Список моделей."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}