caiiofc/llm-agent-api
0
1---2title: Llm Agent Api3emoji: 🌍4colorFrom: blue5colorTo: gray6sdk: docker7pinned: false8license: mit9---10 11# 🧠 LLM Agent API12 13API REST com modelo Llama 2 7B rodando localmente usando llama-cpp-python.14 15## Endpoints16 17### POST /chat18 19Envia mensagem para o agente LLM.20 21**Request:**22 23```json24{25 "message": "Olá, como você está?",26 "max_tokens": 100,27 "temperature": 0.728}29```30 31**Response:**32 33```json34{35 "response": "Olá! Estou bem, obrigado por perguntar. Como posso ajudá-lo hoje?"36}37```38 39### GET /health40 41Verifica status da API.42 43**Response:**44 45```json46{47 "status": "healthy"48}49```50 51## Como usar52 53### Local54 55```bash56curl -X POST "http://localhost:7860/chat" \57 -H "Content-Type: application/json" \58 -d '{"message": "Explique machine learning em 3 frases", "max_tokens": 150, "temperature": 0.3}'59```60 61### Hugging Face Spaces62 63```bash64curl -X POST "https://caiiofc-llm-agent-api.hf.space/chat" \65 -H "Content-Type: application/json" \66 -d '{"message": "Explique machine learning em 3 frases", "max_tokens": 100, "temperature": 0.75}'67```68 69### Teste de saúde70 71```bash72# Local73curl http://localhost:7860/health74 75# HF Spaces76curl https://caiiofc-llm-agent-api.hf.space/health77```78 79## Tecnologias80 81- FastAPI82- llama-cpp-python83- Uvicorn84 