Skip to content

Instantly share code, notes, and snippets.

View EvilFreelancer's full-sized avatar

Pavel Zloi EvilFreelancer

View GitHub Profile
@EvilFreelancer
EvilFreelancer / wikipedia_generator.py
Last active October 5, 2025 21:59
Script for converting wikipedia dataset to plain-text with format of LLM tokenizer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Build single-line calibration prompts from Wikimedia Wikipedia (subset like 20231101.ru).
For each article:
- messages = [{"role": "user", "content": f"{title}\n\n{text}"}]
- render via tokenizer.apply_chat_template(..., add_generation_prompt=True)
- optionally inject BOS/EOS (sample-level or message-level)
- replace real newlines with literal '\n'
@EvilFreelancer
EvilFreelancer / generator.py
Created October 5, 2025 16:30
OpenRLHF-like dataset coverter to TXT file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Build a full calibration text that includes both the prompt (rendered via chat_template)
and the expected assistant reply parsed from `label`.
- Reads mem-agent JSONL with:
- context_messages: list of {role, content}
- label: string that contains separators and, at the end, the gold answer
@EvilFreelancer
EvilFreelancer / Dockerfile
Last active November 11, 2025 17:54
mem-agent MCP setup with vLLM on RTX 4090
FROM python:3.11-slim
# Install system dependencies
RUN apt update \
&& apt install -fy \
git curl build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install uv and add to path
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
@EvilFreelancer
EvilFreelancer / song.txt
Created July 15, 2025 20:23
Pavel Zloi - Где Мой AGI ?!
[Intro]
[ska chorus]
[Verse 1]
Решил структуру поправить —
Фабрики везде расставить,
Модули, схемы, давай всё чинить,
Но пришлось весь движ сломать и хранить.
Комменты стерты,
{"objects":[{"bbox_2d":[144,97,241,120],"label":"Number and Title","text":"8.4 Область действия переменных","confidence":null},{"bbox_2d":[397,98,418,119],"label":"Page Number","text":"38","confidence":null},{"bbox_2d":[145,123,318,146],"label":"Number and Title","text":"8.5 Описание алгоритмов переменных и программ","confidence":null},{"bbox_2d":[397,125,418,146],"label":"Page Number","text":"39","confidence":null},{"bbox_2d":[146,149,395,170],"label":"Number and Title","text":"9 ИСПОЛЬЗОВАНИЕ МОДУЛЕЙ В ТУРБО-ПАСКАЛЕ МОДУЛЬ СRT","confidence":null},{"bbox_2d":[445,149,466,169],"label":"Page Number","text":"44","confidence":null},{"bbox_2d":[165,176,269,194],"label":"Subtitle","text":"9. 1 Общие сведения","confidence":null},{"bbox_2d":[445,176,466,194],"label":"Page Number","text":"44","confidence":null},{"bbox_2d":[165,198,265,215],"label":"Subtitle","text":"9. 2 Работа с экраном дисплея","confidence":null},{"bbox_2d":[217,197,437,216],"label":"Text","text":"в текстовом режиме","confidence":null},{"bbox_2d":[
@EvilFreelancer
EvilFreelancer / llamacpp.log
Created July 6, 2025 13:04
intel arc a770 log on llama.cpp
pasha@gpu01:~/containers/llama.cpp$ ./build/bin/llama-server -hf unsloth/Qwen3-1.7B-GGUF:Q4_K_M
WARNING: Small BAR detected for device 0000:06:00.0
WARNING: Small BAR detected for device 0000:84:00.0
WARNING: Small BAR detected for device 0000:06:00.0
WARNING: Small BAR detected for device 0000:84:00.0
[New LWP 7785]
[New LWP 7784]
[New LWP 7783]
[New LWP 7782]
@EvilFreelancer
EvilFreelancer / docker-compose.ollama.yaml
Created June 22, 2025 18:49
Docker Compose with Ollama
x-shared-logs: &shared-logs
logging:
driver: "json-file"
options:
max-size: "10k"
services:
ollama:
image: ollama/ollama:0.9.2
@EvilFreelancer
EvilFreelancer / evaluation.frida-gguf.ipynb
Last active May 27, 2025 11:24
FRIDA GGUF тестирование
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EvilFreelancer
EvilFreelancer / Dockerfile
Last active April 20, 2025 12:00
LiteLLM usage (total, prompt, completion) promepteus exporter by user by llm model
FROM python:3.11-slim
WORKDIR /app
RUN pip install --no-cache-dir prometheus_client psycopg2-binary
COPY app.py .
EXPOSE 9090
CMD ["python", "app.py"]
@EvilFreelancer
EvilFreelancer / docker-compose.yml
Created March 18, 2025 10:32
Конфиг docker-compose.yml с ollama и open-webui
x-shared-logs: &shared-logs
logging:
driver: "json-file"
options:
max-size: "10k"
services:
ollama:
image: ollama/ollama:0.6.0