self-hosted-ai
Skill7 starsChanged 4 months agoMITView on GitHub
Запуск AI локально: Ollama, Llama 3, подключение к Telegram-ботам, n8n. Полный гайд от установки до продакшна.
- Pipes a download into a shell
In this repository23 other files it gives its agents.
- content-pipelineSkill
- adaptive-loopsSkill
- api-cost-trackerSkill
- memory-compactorSkill
- memory-guardianSkill
- post-mortem-analyzerSkill
- reflexive-trigger-boostSkill
- skill-trigger-systemSkill
- agent-communicationSkill
- auto-qa-gatesSkill
- cost-aware-orchestratorSkill
- decision-frameworkSkill
- GitHub Publish WorkflowSkill
- harvest-usageSkill
- network-restricted-hermesSkill
- omniroute-masterySkill
- reflection-qaSkill
- russia-hacksSkill
- session-hygiene-plusSkill
- telegram-bot-patternsSkill
- tool-proficiency-trackerSkill
- trading-bot-deploymentSkill
- security-auditSkill
The file
Files
Self-Hosted AI — Локальный AI
Активировать: когда нужно запустить AI без облака и платных API.
Цель: Иметь своего AI-агента, который работает 24/7 на твоём компьютере.
Зачем
Из РФ заблокированы OpenAI, Anthropic, Google. Даже через прокси — дорого и ненадёжно. Локальный AI:
- Бесплатен
- Не зависит от блокировок
- Работает офлайн
- Данные не уходят на серверы
Установка Ollama
Windows
- Скачай с ollama.com
- Установи
- Запусти
Linux (WSL2)
curl -fsSL https://ollama.com/install.sh | shПроверка
ollama --version
ollama listМодели
Какую модель выбрать
| Модель | Размер | ОЗУ | Качество | Скорость |
| Llama 3.1 8B | 4.7 GB | 8 GB | Среднее | Быстро |
| Llama 3.1 70B | 40 GB | 48 GB | Высокое | Медленно |
| Mistral 7B | 4 GB | 8 GB | Среднее | Быстро |
| DeepSeek V3 | 16 GB | 24 GB | Высокое | Средне |
Для начинающих: Llama 3.1 8B — баланс качество/скорость.
Скачивание
ollama pull llama3.1:8b
ollama pull mistral:7bЗапуск
# Интерактивный режим
ollama run llama3.1:8b
# API (для ботов)
ollama serve
# Доступен на http://localhost:11434Подключение к Telegram-боту
Через aiogram 3
import httpx
from aiogram import Bot, Router, F
from aiogram.types import Message
bot = Bot(token="YOUR_TOKEN")
router = Router()
async def ask_ollama(prompt: str) -> str:
async with httpx.AsyncClient() as client:
response = await client.post(
"http://localhost:11434/api/generate",
json={
"model": "llama3.1:8b",
"prompt": prompt,
"stream": False
}
)
return response.json()["response"]
@router.message(F.text)
async def handle(message: Message):
answer = await ask_ollama(message.text)
await message.answer(answer)Подключение к Hermes Agent
Конфигурация
# ~/.hermes/config.yaml
model:
default: ollama/llama3.1:8b
provider: ollama
base_url: http://localhost:11434/v1Запуск
hermes chatDocker Compose (продакшн)
version: "3.8"
services:
ollama:
image: ollama/ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
restart: unless-stopped
n8n:
image: n8nio/n8n
ports:
- "5678:5678"
environment:
- OLLAMA_API=http://ollama:11434
restart: unless-stopped
volumes:
ollama_data:docker-compose up -dАвтоматизация (n8n)
n8n — визуальный конструктор автоматизаций. Работает с Ollama.
Установка
docker run -d --name n8n -p 5678:5678 n8nio/n8nПример workflow
- Telegram Trigger → получено сообщение
- HTTP Request → Ollama API
- Telegram Send → ответ пользователю
Правила
- ВСЕГДА используй
stream: Falseдля API-вызовов - ВСЕГДА проверяй доступную ОЗУ перед скачиванием модели
- НИКОГДА не запускай больше одной модели одновременно (без GPU)
- НИКОГДА не используй модели больше 8B без GPU
- Если тормозит — уменьши контекст или используй более мелкую модель
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

