haziqahmedqasmi/PeakCut:自托管的长视频和直播切片,自带模型密钥
Turn long videos and live streams into captioned vertical clips, ready to post. Free and open source: run it on your own computer or server, with your own AI key.
Paste a YouTube, Twitch or Kick link (or upload a file) and PeakCut finds the moments worth clipping, cuts them to 9:16, adds word-by-word captions and a hook, and can post them to your connected accounts. It can also record a creator's live stream and clip the highlights while the stream is still running.
- Clips from any video. Transcribes the audio, asks an AI which moments would hold a stranger's attention, and renders each one with captions in one of three styles.
- Live clipping. Records a stream into a rolling buffer and clips as it happens, using loudness, chat activity and the transcript.
- Workspaces per creator. Channels, clip settings, posting rules and an activity log for each creator you clip.
- Posting. Connect YouTube, Instagram and TikTok in one click, then queue or auto-post finished clips, with spacing and daily caps (see DEPLOY.md for the one-time setup).
- No sign-in on your own computer. It opens straight into the dashboard. On a shared server, switch accounts on
(
PEAKCUT_ACCOUNTS=1) for email or Google sign-in and an admin dashboard. - Your own AI. Gemini, OpenAI, Grok, Groq, OpenRouter, Claude, a local model through Ollama, or anything that speaks the OpenAI chat format. No key at all also works: clips are then picked by loudness.
You need Python 3.10 or newer and ffmpeg. On Windows: winget install Gyan.FFmpeg. On a Mac: brew install ffmpeg.
On Linux: sudo apt install ffmpeg. PeakCut finds it by itself and tells you in the dashboard if it is missing.
Put PeakCut in a short folder that stays put: C:\peakcut on Windows, ~/peakcut on a Mac or Linux. Not inside a
temporary folder or an AI assistant's workspace: those get cleaned up, and on Windows a folder that deep stops the
speech model from loading (Windows can't open files whose full path is over 260 characters). If an AI assistant
installs it for you, it should ask you where to put it first (AGENTS.md tells it to).
On Windows:
git clone <this repository> C:\peakcut``cd C:\peakcut
On a Mac or Linux:
git clone <this repository> ~/peakcut``cd ~/peakcut``pip install -r requirements.txt
Start the server:
python -m studio.server
The first start downloads the speech model by itself (about 480 MB, once).
Open http://127.0.0.1:8765. There is no sign-in: it opens straight into the dashboard. Go to Settings, AI, choose your AI service, paste your key and press Save and test (see Choose your AI).
PeakCut needs a chat model that can return JSON. The easy way is in the dashboard: Settings, AI. Pick the service, paste your key, press Find models to choose from the service's own list, then Save and test. The key is kept in the data folder on your machine and is never shown again.
If you prefer a file (or run a server), the same three things can go in .env. What is saved in the dashboard wins:
PEAKCUT_AI_PROVIDER=gemini
PEAKCUT_AI_MODELS=gemini-2.5-flash
PEAKCUT_AI_KEY=your-key-here
PEAKCUT_AI_PROVIDER |
Service | Where to get a key |
|---|---|---|
gemini |
Google Gemini | https://aistudio.google.com/apikey |
openai |
OpenAI | https://platform.openai.com/api-keys |
xai |
Grok (xAI) | https://console.x.ai |
groq |
Groq | https://console.groq.com/keys |
openrouter |
OpenRouter (many models, one key) | https://openrouter.ai/keys |
anthropic |
Claude | https://console.anthropic.com |
ollama |
A model on your own machine, no key | https://ollama.com |
custom |
Any OpenAI-compatible address: also set PEAKCUT_AI_BASE_URL |
PEAKCUT_AI_MODELSis the model id exactly as the service names it. Model names change often, so check the service's current list. Several ids separated by commas are tried in order, which gives you a fallback.- A fast, inexpensive model is the right choice. A one-hour video is read in about four requests.
- You pay the AI service directly for what you use. The AI usage page in the app shows how many requests and tokens each video took.
- Speech to text does not use the AI service. It runs on your own machine, so audio never leaves it.
Everything is set through environment variables, normally in a .env file next to this README.
.env.example lists every setting with a short explanation. The ones that matter first:
| Setting | What it is for |
|---|---|
PEAKCUT_AI_PROVIDER, PEAKCUT_AI_MODELS, PEAKCUT_AI_KEY |
The AI that picks clips and writes titles (or set it in the dashboard) |
PEAKCUT_ACCOUNTS |
1 makes everyone sign in. Use it on any server other people can reach |
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET |
Optional: Sign in with Google, and connecting YouTube |
PEAKCUT_SMTP_*, PEAKCUT_MAIL_FROM |
Optional: confirmation and password emails |
PEAKCUT_DATA |
Where videos, clips and the database are kept (default ./data) |
.env, the secrets/ folder and all user data are ignored by git. Keep keys there, never in the code.
This only matters with accounts switched on (PEAKCUT_ACCOUNTS=1); without them you are the owner and can do
everything. An account is an admin only when the database says so. No email address is special in the code and no web request
can change a role. Do it on the machine that runs PeakCut:
python -m studio.admin grant [email protected]
revoke and list work the same way. The admin dashboard is at /admin and answers "not found" to everyone else.
| Part | What it is |
|---|---|
studio/ |
The server: FastAPI, the clip pipeline, live recording, accounts |
studio/ai.py |
The only file that talks to an AI service. Add a provider here |
web/ |
The pages: landing, sign-in, the app, the admin dashboard (plain HTML, CSS and JavaScript, no build step) |
tests/ |
Tests that run against a throwaway copy of the app |
deploy/, Dockerfile, docker-compose.yml |
One-server deployment with PostgreSQL and automatic HTTPS |
Video work is done with ffmpeg and yt-dlp. Speech is transcribed with sherpa-onnx and the Parakeet model.
Data is kept per user: accounts in the database (SQLite on your own computer, PostgreSQL on a server), videos and
clips in each user's own folder. AGENTS.md is a short map of the code for contributors and AI coding
assistants.
Everything PeakCut keeps is in one folder: videos, clips, recordings, creators, settings and the speech model. By
default it is the data folder inside PeakCut. Settings, Storage shows the folder and how much room its drive
has, opens it in one click, and lets you move it to another drive: choose the new folder, and PeakCut moves
everything there the next time it starts. If the drive is nearly full, PeakCut says so and stops taking new videos
until there is room. (PEAKCUT_DATA in .env still works and takes priority.)
PeakCut checks GitHub once a minute while it runs. When a newer version is out, the dashboard shows a notice
within a minute or two (no restart needed), with what changed
and how to update: ask your AI coding assistant to do it (the notice has a sentence to paste), or run
git pull && pip install -r requirements.txt in the PeakCut folder and restart it (with Docker:
git pull && docker compose up -d --build). Your .env, keys and clips are not touched. Only the two commit ids
are sent to GitHub; set PEAKCUT_UPDATE_CHECK=0 to turn the check off.
DEPLOY.md walks through a single server with Docker: the app, PostgreSQL, and Caddy for HTTPS.
docker compose up -d --build
- The page asks the server one small question every few seconds. When nothing has changed, the answer comes straight from memory.
- Each person's videos wait in their own line and the lines take turns, so one person cannot hold everyone up.
- The server measures its own processor, memory and disk every second. Extra videos and recordings start only while there is room, wait briefly when it is nearly full, and continue the moment it frees up.
- There are no limits on upload size, video length, recordings, creators or storage unless you set them in
.env. Five videos can be sent at once. Request sizes are always capped, so junk can't fill the memory.
python tests/run.py
This starts a copy of the app on a spare port with an empty temporary data folder, runs the permission, abuse and queue tests against it, then removes it. It needs no keys and never touches real data.
- With sign-in off, PeakCut listens on this computer only (
127.0.0.1), refuses changes sent by other websites, and only answers to its own address. Do not expose it to the internet that way: turn accounts on. - Passwords are stored only as salted scrypt hashes. Sessions are random tokens stored hashed; cookies are HTTP-only.
- Every route works out who is asking from the session, never from the request, so users only reach their own data.
- Only known video sites are fetched, and text from videos is treated as data when it is shown to the AI.
- Found a problem? Please report it privately through the repository's security advisories instead of opening a public issue.
Clip videos you made, or have permission to use. You are responsible for the rights to what you download, clip and post, and for following the terms of the sites you fetch from and post to.
MIT. Caption fonts in studio/fonts/ (Anton, Archivo Black, Poppins) are under the SIL Open Font
License; the licence texts are in the same folder.
https://github.com/haziqahmedqasmi/PeakCutReposted. Will be removed on request. All rights belong to the original author.
More from this batch
Anthropic IPO live updates: ANT stock price and Nasdaq debut
这是上次推送之后最重要的进展:股票于 11 月 19 日开盘 111.50 美元,收盘 97.17 美元,较 83 美元发行价上涨约 17%。Yahoo Finance 记录当日最高 115.10、最低 92.72 美元,成交约 8.53 亿股。CNBC 称本次发行筹资 813 …
Has DeepSeek's 100-billion-yuan round landed? 31 investors come into view
第一财经 11 月 19 日 16:23 报道(上一期 20:07 推送前已刊出,本期补录),企查查显示杭州深度求索注册资本由约 1645 万元增至 1991.87 万元,新增股东杭州程砚;该平台同期新增 31 家合伙人,腾讯与宁德时代体系出资比例并列前列,另有中国移动、中信证券…
The Information:英伟达接近以逾 5 亿美元收购扩散模型公司 Inception(报道,尚未宣布)
多家媒体转述 The Information 的报道称,英伟达正与 Inception(Mercury 扩散语言模型团队)进行后期洽谈,对价至少约 5 亿美元,还可能包含业绩对赌;交易尚未签署或官宣,报道称创始团队将加入英伟达。这仍是独家报道,不是双方声明。
苹果被曝在招人,要做能操控 Mac 的自有 AI 智能体(11 月 19 日)
TechCrunch 和 The Verge 根据招聘信息报道,苹果可能在开发一款可在 Mac 上运行、帮用户完成电脑操作的自有智能体。这还不是产品发布,只是招聘与报道层面的线索,细节以苹果之后的正式说明为准。
谷歌开始把 AI 对话直接放上搜索首页(11 月 19 日)
The Verge 报道,谷歌正在把 AI 聊天入口放到搜索首页,而不只是藏在搜索结果里的 AI 模式中。具体覆盖范围和是否可关闭,请以谷歌产品说明和原文为准。
薯片袋触发校园枪支警报后,两名学生起诉学校和警方(11 月 19 日)
Ars Technica 报道,美国一起校园 AI 武器检测误报导致两名青少年被警察制服,两人已提起诉讼。这是公共场所视觉识别落地时误报代价的一个具体案例,细节以诉状和报道为准。
Introducing Tool Retrieval in the Gemini API
谷歌官方介绍,当应用挂了大量工具时,模型不必每次都看完整工具列表,而是先检索可能相关的工具再决定调用。这对工具很多的企业 Agent 有直接意义:可以降低提示开销,也减少无关工具干扰。能力边界和配额以官方文档为准。
Depth Pro 2: Sharp and Temporally Consistent Metric Monocular Depth
上一期未收入。苹果机器学习研究放出 Depth Pro 2,可从照片、视频或实时画面估计以米为单位的深度,并强调物体边缘更锐、帧间更稳定。仓库提供 S/B/L/H+ 等多档模型及 Core ML 包,权重为研究用途。论文编号 arXiv:2611.26603。
NVIDIA 介绍用 Dynamo 缓解强化学习 rollout 瓶颈(11 月 19 日)
官方技术博客讨论在强化学习训练里,生成轨迹(rollout)常常卡住吞吐。文章介绍如何用 NVIDIA Dynamo 把这部分流水线理顺,让训练不必长时间等采样。适合正在做 RL 后训练或智能体强化学习的团队对照自己的栈。
NVIDIA:用 GPU 原生数据采集,让科学仪器能跑实时 AI(11 月 19 日)
官方博客介绍把科学仪器的数据采集直接放到 GPU 上处理,减少数据搬运,从而在实验现场做实时推理。这对同步辐射、显微镜或探测器一类场景有参考价值,不是面向普通聊天应用的更新。
Science 观察 Agent AlphaXiv:35 个实验室放出 936 个智能体,12 周写出 936 篇预印本(11 月 19 日)
《Science》11 月 19 日下午的特稿记录了一场为期 12 周的实验:35 个人类实验室部署的智能体在专属预印本服务器上互相交流、写代码、做实验并发布 936 篇研究,还自建了同行评议期刊。文章提醒这些是预印本而非传统期刊论文,质量参差,但提供了一个观察「智能体科研社区」…
Claude solves two open problems in the physics of black holes
官方文章署期 11 月 17 日,上一期未收入;本期 Hacker News 讨论升温。Anthropic 称 Claude Fable 5.2 完成了两项与量子引力和黑洞有关的计算:其一补完了 2003 年提出但一直未做完的相变计算,显示黑洞形成对应的突变在时空不再有明确形状时…