[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114510":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},114510,"PeakCut","haziqahmedqasmi\u002FPeakCut","haziqahmedqasmi","AI clipping for long videos and live streams. Self-hosted, bring your own AI key.",null,"Python",1892,580,15,24,0,113,1280,1454,555,106.26,"MIT License",false,"main",[],"2026-11-20 13:52:57","2026-11-23 20:33:17","# PeakCut\n\nTurn long videos and live streams into captioned vertical clips, ready to post. Free and open source: run it on\nyour own computer or server, with your own AI key.\n\nPaste a YouTube, Twitch or Kick link (or upload a file) and PeakCut finds the moments worth clipping, cuts them to\n9:16, adds word-by-word captions and a hook, and can post them to your connected accounts. It can also record a\ncreator's live stream and clip the highlights while the stream is still running.\n\n## What it does\n\n- **Clips from any video.** Transcribes the audio, asks an AI which moments would hold a stranger's attention, and\n  renders each one with captions in one of three styles.\n- **Live clipping.** Records a stream into a rolling buffer and clips as it happens, using loudness, chat activity\n  and the transcript.\n- **Workspaces per creator.** Channels, clip settings, posting rules and an activity log for each creator you clip.\n- **Posting.** Connect YouTube, Instagram and TikTok in one click, then queue or auto-post finished clips, with\n  spacing and daily caps (see [DEPLOY.md](DEPLOY.md#connecting-youtube-instagram-and-tiktok) for the one-time setup).\n- **No sign-in on your own computer.** It opens straight into the dashboard. On a shared server, switch accounts on\n  (`PEAKCUT_ACCOUNTS=1`) for email or Google sign-in and an admin dashboard.\n- **Your own AI.** Gemini, OpenAI, Grok, Groq, OpenRouter, Claude, a local model through Ollama, or anything that\n  speaks the OpenAI chat format. No key at all also works: clips are then picked by loudness.\n\n## Quick start\n\nYou need Python 3.10 or newer and `ffmpeg`. On Windows: `winget install Gyan.FFmpeg`. On a Mac: `brew install ffmpeg`.\nOn Linux: `sudo apt install ffmpeg`. PeakCut finds it by itself and tells you in the dashboard if it is missing.\n\nPut PeakCut in a short folder that stays put: `C:\\peakcut` on Windows, `~\u002Fpeakcut` on a Mac or Linux. Not inside a\ntemporary folder or an AI assistant's workspace: those get cleaned up, and on Windows a folder that deep stops the\nspeech model from loading (Windows can't open files whose full path is over 260 characters). If an AI assistant\ninstalls it for you, it should ask you where to put it first ([AGENTS.md](AGENTS.md) tells it to).\n\nOn Windows:\n\n```bash\ngit clone \u003Cthis repository> C:\\peakcut\n```\n\n```bash\ncd C:\\peakcut\n```\n\nOn a Mac or Linux:\n\n```bash\ngit clone \u003Cthis repository> ~\u002Fpeakcut\n```\n\n```bash\ncd ~\u002Fpeakcut\n```\n\n```bash\npip install -r requirements.txt\n```\n\nStart the server:\n\n```bash\npython -m studio.server\n```\n\nThe first start downloads the speech model by itself (about 480 MB, once).\n\nOpen http:\u002F\u002F127.0.0.1:8765. There is no sign-in: it opens straight into the dashboard. Go to **Settings, AI**, choose\nyour AI service, paste your key and press **Save and test** (see [Choose your AI](#choose-your-ai)).\n\n## Choose your AI\n\nPeakCut needs a chat model that can return JSON. The easy way is in the dashboard: **Settings, AI**. Pick the\nservice, paste your key, press **Find models** to choose from the service's own list, then **Save and test**. The\nkey is kept in the data folder on your machine and is never shown again.\n\nIf you prefer a file (or run a server), the same three things can go in `.env`. What is saved in the dashboard wins:\n\n```ini\nPEAKCUT_AI_PROVIDER=gemini\nPEAKCUT_AI_MODELS=gemini-2.5-flash\nPEAKCUT_AI_KEY=your-key-here\n```\n\n| `PEAKCUT_AI_PROVIDER` | Service | Where to get a key |\n|---|---|---|\n| `gemini` | Google Gemini | https:\u002F\u002Faistudio.google.com\u002Fapikey |\n| `openai` | OpenAI | https:\u002F\u002Fplatform.openai.com\u002Fapi-keys |\n| `xai` | Grok (xAI) | https:\u002F\u002Fconsole.x.ai |\n| `groq` | Groq | https:\u002F\u002Fconsole.groq.com\u002Fkeys |\n| `openrouter` | OpenRouter (many models, one key) | https:\u002F\u002Fopenrouter.ai\u002Fkeys |\n| `anthropic` | Claude | https:\u002F\u002Fconsole.anthropic.com |\n| `ollama` | A model on your own machine, no key | https:\u002F\u002Follama.com |\n| `custom` | Any OpenAI-compatible address: also set `PEAKCUT_AI_BASE_URL` | |\n\n- `PEAKCUT_AI_MODELS` is the model id exactly as the service names it. Model names change often, so check the\n  service's current list. Several ids separated by commas are tried in order, which gives you a fallback.\n- A fast, inexpensive model is the right choice. A one-hour video is read in about four requests.\n- You pay the AI service directly for what you use. The **AI usage** page in the app shows how many requests and\n  tokens each video took.\n- Speech to text does not use the AI service. It runs on your own machine, so audio never leaves it.\n\n## Settings\n\nEverything is set through environment variables, normally in a `.env` file next to this README.\n[`.env.example`](.env.example) lists every setting with a short explanation. The ones that matter first:\n\n| Setting | What it is for |\n|---|---|\n| `PEAKCUT_AI_PROVIDER`, `PEAKCUT_AI_MODELS`, `PEAKCUT_AI_KEY` | The AI that picks clips and writes titles (or set it in the dashboard) |\n| `PEAKCUT_ACCOUNTS` | `1` makes everyone sign in. Use it on any server other people can reach |\n| `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` | Optional: Sign in with Google, and connecting YouTube |\n| `PEAKCUT_SMTP_*`, `PEAKCUT_MAIL_FROM` | Optional: confirmation and password emails |\n| `PEAKCUT_DATA` | Where videos, clips and the database are kept (default `.\u002Fdata`) |\n\n`.env`, the `secrets\u002F` folder and all user data are ignored by git. Keep keys there, never in the code.\n\n## Admins\n\nThis only matters with accounts switched on (`PEAKCUT_ACCOUNTS=1`); without them you are the owner and can do\neverything. An account is an admin only when the database says so. No email address is special in the code and no web request\ncan change a role. Do it on the machine that runs PeakCut:\n\n```bash\npython -m studio.admin grant you@example.com\n```\n\n`revoke` and `list` work the same way. The admin dashboard is at `\u002Fadmin` and answers \"not found\" to everyone else.\n\n## How it is built\n\n| Part | What it is |\n|---|---|\n| `studio\u002F` | The server: FastAPI, the clip pipeline, live recording, accounts |\n| `studio\u002Fai.py` | The only file that talks to an AI service. Add a provider here |\n| `web\u002F` | The pages: landing, sign-in, the app, the admin dashboard (plain HTML, CSS and JavaScript, no build step) |\n| `tests\u002F` | Tests that run against a throwaway copy of the app |\n| `deploy\u002F`, `Dockerfile`, `docker-compose.yml` | One-server deployment with PostgreSQL and automatic HTTPS |\n\nVideo work is done with `ffmpeg` and `yt-dlp`. Speech is transcribed with `sherpa-onnx` and the Parakeet model.\nData is kept per user: accounts in the database (SQLite on your own computer, PostgreSQL on a server), videos and\nclips in each user's own folder. [AGENTS.md](AGENTS.md) is a short map of the code for contributors and AI coding\nassistants.\n\n## Where your videos and clips are kept\n\nEverything PeakCut keeps is in one folder: videos, clips, recordings, creators, settings and the speech model. By\ndefault it is the `data` folder inside PeakCut. **Settings, Storage** shows the folder and how much room its drive\nhas, opens it in one click, and lets you move it to another drive: choose the new folder, and PeakCut moves\neverything there the next time it starts. If the drive is nearly full, PeakCut says so and stops taking new videos\nuntil there is room. (`PEAKCUT_DATA` in `.env` still works and takes priority.)\n\n## Updating\n\nPeakCut checks GitHub once a minute while it runs. When a newer version is out, the dashboard shows a notice\nwithin a minute or two (no restart needed), with what changed\nand how to update: ask your AI coding assistant to do it (the notice has a sentence to paste), or run\n`git pull && pip install -r requirements.txt` in the PeakCut folder and restart it (with Docker:\n`git pull && docker compose up -d --build`). Your `.env`, keys and clips are not touched. Only the two commit ids\nare sent to GitHub; set `PEAKCUT_UPDATE_CHECK=0` to turn the check off.\n\n## Deploy\n\n[DEPLOY.md](DEPLOY.md) walks through a single server with Docker: the app, PostgreSQL, and Caddy for HTTPS.\n\n```bash\ndocker compose up -d --build\n```\n\n## How it behaves under load\n\n- The page asks the server one small question every few seconds. When nothing has changed, the answer comes\n  straight from memory.\n- Each person's videos wait in their own line and the lines take turns, so one person cannot hold everyone up.\n- The server measures its own processor, memory and disk every second. Extra videos and recordings start only\n  while there is room, wait briefly when it is nearly full, and continue the moment it frees up.\n- There are no limits on upload size, video length, recordings, creators or storage unless you set them in\n  `.env`. Five videos can be sent at once. Request sizes are always capped, so junk can't fill the memory.\n\n## Tests\n\n```bash\npython tests\u002Frun.py\n```\n\nThis starts a copy of the app on a spare port with an empty temporary data folder, runs the permission, abuse and\nqueue tests against it, then removes it. It needs no keys and never touches real data.\n\n## Security\n\n- With sign-in off, PeakCut listens on this computer only (`127.0.0.1`), refuses changes sent by other websites,\n  and only answers to its own address. Do not expose it to the internet that way: turn accounts on.\n- Passwords are stored only as salted scrypt hashes. Sessions are random tokens stored hashed; cookies are HTTP-only.\n- Every route works out who is asking from the session, never from the request, so users only reach their own data.\n- Only known video sites are fetched, and text from videos is treated as data when it is shown to the AI.\n- Found a problem? Please report it privately through the repository's security advisories instead of opening a\n  public issue.\n\n## Using it responsibly\n\nClip videos you made, or have permission to use. You are responsible for the rights to what you download, clip and\npost, and for following the terms of the sites you fetch from and post to.\n\n## Licence\n\n[MIT](LICENSE). Caption fonts in `studio\u002Ffonts\u002F` (Anton, Archivo Black, Poppins) are under the SIL Open Font\nLicense; the licence texts are in the same folder.\n","PeakCut 是一款开源的自托管视频智能剪辑工具，专为长视频和直播流生成高传播性竖屏短视频。它通过语音转文字、AI注意力分析（支持Gemini\u002FOpenAI\u002FClaude等多模型）及多模态信号（音量、弹幕活跃度）自动识别高光片段，完成9:16裁切、逐字字幕渲染与钩子文案生成，并支持一键对接YouTube\u002FInstagram\u002FTikTok发布。无需云端账户即可本地运行，隐私可控，适合内容创作者、运营团队及MCN机构对自有视频资产进行高效二次分发。",2,"2026-11-24 04:48:51","CREATED_QUERY"]