MinerU
Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Cited knowledge graphs from local documents, extracted by small Ollama models on idle machines.
제작자가 쓴 원문
이런 작업을 AI에게 가르치는 Skill, 이것과 함께 쓸 수 있습니다
Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Agent skills for Obsidian. Teach your agent to use Obsidian CLI and open formats including Markdown, Bases, JSON Canvas.
목록은 사용 점수(100점 만점)로 정렬되며 구성은 다음과 같습니다
| 인기 | 4/80 | GitHub 별 또는 주간 다운로드: 큰 쪽 60, 작은 쪽 20 |
|---|---|---|
| 최신성 | 12/12 | 30일 안에 릴리스나 코드 변경이 있으면 만점 |
| 응답 중 | 0/8 | 마지막 점검 때 클라우드 엔드포인트가 응답 |
| 사용 점수 | 16/100 |
품질: 기본 점검 3/3개 통과(표시만, 정렬에는 안 씀) · 상승세: 데이터 없음 (급상승 탭에서만 사용)
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
한 문장으로 AI에게 설치 맡기기
Nightshift Grid 설치해 줘. https://mcp.popnx.com/i/redd34-nightshift-grid.md 를 따라 하고, 명령을 먼저 보여 주고 내가 승인하면 실행해.내 컴퓨터에서 작업하는 AI(Claude Code, Cursor 등)에 붙여 넣으세요. 단계를 읽고 명령을 보여 준 뒤 승인을 기다립니다. 키도 가입도 필요 없습니다. · AI가 읽을 전체 내용 보기
검사 3/3 통과 · 내 컴퓨터에서 실행돼요 · ✓ 명령 확인 2026년 11월 15일
먼저: 어떤 AI를 쓰시나요?
쓰는 앱을 고르면 아래에 단계가 나옵니다.
Claude에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Python (uv)를 설치하세요 (한 번만) · 컴퓨터용 Claude 앱(Windows 또는 Mac)에서만 되고 웹이나 모바일은 안 돼요
이 메시지를 Claude 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 Claude에 MCP server Nightshift Grid을 설치해 주세요. 순서대로: 1) uv --version로 uv가 있는지 확인. 없으면 https://docs.astral.sh/uv/getting-started/installation/에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): { "mcpServers": { "nightshift-grid": { "command": "uvx", "args": [ "nightshift-grid" ] } } } 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 Nightshift Grid의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
uv --versionMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: uv에는 클릭형 설치 파일이 없습니다. uv 공식 페이지에서 내 시스템(macOS 또는 Windows)용 한 줄 명령을 복사해 터미널에 붙여 넣으세요 · Python을 따로 설치할 필요 없이 uv가 필요할 때 자동으로 내려받습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: uv --version
한 번 설치하면 uv가 필요한 모든 도구에서 쓸 수 있습니다
SettingsDeveloperEdit Config
{
"mcpServers": {
"nightshift-grid": {
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}Nightshift Grid을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Claude가 Nightshift Grid을 쓰고 있다고 하거나 답에 Nightshift Grid 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
NIGHTSHIFT_URL Coordinator URL. 설정하지 않으면 이 머신에서 nightshift up으로 시작된 그리드를 사용합니다. NIGHTSHIFT_TOKEN_FILE coordinator 클라이언트 토큰을 저장하는 파일입니다(NIGHTSHIFT_URL을 사용할 때만 필요). NIGHTSHIFT_MCP_ROOTS 서버가 문서를 읽을 수 있는 폴더(기본값: 현재 디렉터리). 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
ChatGPT는 아직 Nightshift Grid에 연결할 수 없어요
Nightshift Grid는 내 컴퓨터에 설치해서 쓰지만 ChatGPT는 웹에서 도는 서버만 연결할 수 있어요
A · Nightshift Grid에 연결되는 앱 쓰기
Claude Code에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Python (uv)를 설치하세요 (한 번만)
이 메시지를 Claude Code 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 Claude Code에 MCP server Nightshift Grid을 설치해 주세요. 순서대로: 1) uv --version로 uv가 있는지 확인. 없으면 https://docs.astral.sh/uv/getting-started/installation/에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): claude mcp add --scope user nightshift-grid -- uvx nightshift-grid 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 Nightshift Grid의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
uv --versionMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: uv에는 클릭형 설치 파일이 없습니다. uv 공식 페이지에서 내 시스템(macOS 또는 Windows)용 한 줄 명령을 복사해 터미널에 붙여 넣으세요 · Python을 따로 설치할 필요 없이 uv가 필요할 때 자동으로 내려받습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: uv --version
한 번 설치하면 uv가 필요한 모든 도구에서 쓸 수 있습니다
Mac: Command+스페이스를 누르고 Terminal 입력 · Windows: PowerShell 열기
claude mcp add --scope user nightshift-grid -- uvx nightshift-gridNightshift Grid이 목록에 있고 연결됨으로 보이면 돼요
Nightshift Grid을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Claude Code가 Nightshift Grid을 쓰고 있다고 하거나 답에 Nightshift Grid 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
NIGHTSHIFT_URL Coordinator URL. 설정하지 않으면 이 머신에서 nightshift up으로 시작된 그리드를 사용합니다. NIGHTSHIFT_TOKEN_FILE coordinator 클라이언트 토큰을 저장하는 파일입니다(NIGHTSHIFT_URL을 사용할 때만 필요). NIGHTSHIFT_MCP_ROOTS 서버가 문서를 읽을 수 있는 폴더(기본값: 현재 디렉터리). 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
Cursor에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Python (uv)를 설치하세요 (한 번만)
이 메시지를 Cursor 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 Cursor에 MCP server Nightshift Grid을 설치해 주세요. 순서대로: 1) uv --version로 uv가 있는지 확인. 없으면 https://docs.astral.sh/uv/getting-started/installation/에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): { "mcpServers": { "nightshift-grid": { "command": "uvx", "args": [ "nightshift-grid" ] } } } 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 Nightshift Grid의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
uv --versionMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: uv에는 클릭형 설치 파일이 없습니다. uv 공식 페이지에서 내 시스템(macOS 또는 Windows)용 한 줄 명령을 복사해 터미널에 붙여 넣으세요 · Python을 따로 설치할 필요 없이 uv가 필요할 때 자동으로 내려받습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: uv --version
한 번 설치하면 uv가 필요한 모든 도구에서 쓸 수 있습니다
Nightshift Grid을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ Cursor가 Nightshift Grid을 쓰고 있다고 하거나 답에 Nightshift Grid 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
NIGHTSHIFT_URL Coordinator URL. 설정하지 않으면 이 머신에서 nightshift up으로 시작된 그리드를 사용합니다. NIGHTSHIFT_TOKEN_FILE coordinator 클라이언트 토큰을 저장하는 파일입니다(NIGHTSHIFT_URL을 사용할 때만 필요). NIGHTSHIFT_MCP_ROOTS 서버가 문서를 읽을 수 있는 폴더(기본값: 현재 디렉터리). 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 Cursor 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
VS Code에 연결할 수 있지만 먼저 준비가 필요해요
먼저 컴퓨터에 Python (uv)를 설치하세요 (한 번만)
이 메시지를 VS Code 채팅에 붙여 넣으세요. AI가 컴퓨터를 확인하고 어떤 파일을 바꿀지 알려 준 뒤 매번 동의를 기다립니다.
이 컴퓨터의 VS Code에 MCP server Nightshift Grid을 설치해 주세요. 순서대로: 1) uv --version로 uv가 있는지 확인. 없으면 https://docs.astral.sh/uv/getting-started/installation/에서 설치하라고 알려 주고 직접 설치하지 마세요. 2) 이 설정만 사용하세요(PopNx MCP 확인 완료): { "servers": { "nightshift-grid": { "type": "stdio", "command": "uvx", "args": [ "nightshift-grid" ] } } } 3) 바꿀 파일의 전체 경로나 실행할 명령을 알려 주고 제 동의를 기다리세요. 4) 키는 필요 없습니다. 5) 합의한 대로 실행한 뒤 Nightshift Grid의 도구가 실제로 보이는지 확인하세요.이 메시지에는 키가 없습니다. 키가 필요하면 AI가 파일이나 앱 입력란에 직접 붙여 넣으라고 안내합니다.
이미 설치했나요? 먼저 확인 · 터미널을 열고 이 명령을 입력한 뒤 Enter
uv --versionMac: ⌘ + Space를 누르고 Terminal 입력 후 Enter
Windows: 시작 메뉴를 열고 Windows PowerShell 입력 후 "열기"
아직 설치하지 않았다면: uv에는 클릭형 설치 파일이 없습니다. uv 공식 페이지에서 내 시스템(macOS 또는 Windows)용 한 줄 명령을 복사해 터미널에 붙여 넣으세요 · Python을 따로 설치할 필요 없이 uv가 필요할 때 자동으로 내려받습니다
설치가 끝나면 터미널을 닫았다가 다시 열고 같은 명령을 실행하세요. 버전 번호가 나와야 합니다: uv --version
한 번 설치하면 uv가 필요한 모든 도구에서 쓸 수 있습니다
Nightshift Grid을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐✓ VS Code가 Nightshift Grid을 쓰고 있다고 하거나 답에 Nightshift Grid 도구 이름이 나오면 연결된 거예요
위 명령은 이 값들 없이도 동작합니다. 바꾸고 싶을 때만 제작자 설명대로 추가하세요.
NIGHTSHIFT_URL Coordinator URL. 설정하지 않으면 이 머신에서 nightshift up으로 시작된 그리드를 사용합니다. NIGHTSHIFT_TOKEN_FILE coordinator 클라이언트 토큰을 저장하는 파일입니다(NIGHTSHIFT_URL을 사용할 때만 필요). NIGHTSHIFT_MCP_ROOTS 서버가 문서를 읽을 수 있는 폴더(기본값: 현재 디렉터리). 설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
메뉴 이름은 2026년 11월 11일에 VS Code 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요
Claude Code
claude mcp add --scope user nightshift-grid -- uvx nightshift-gridClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"nightshift-grid": {
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"nightshift-grid": {
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"nightshift-grid": {
"type": "stdio",
"command": "uvx",
"args": [
"nightshift-grid"
]
}
}
}NIGHTSHIFT_URL envNIGHTSHIFT_TOKEN_FILE envNIGHTSHIFT_MCP_ROOTS env설명은 자동 번역이며 변수 이름은 원문 그대로입니다. 확실하지 않으면 원문을 확인하세요.
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
pypi: nightshift-grid이 서버의 연결 방식과 각 앱의 공식 문서를 바탕으로 했어요. 2026년 11월 10일 확인.
내 컴퓨터에서 실행하는 앱
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 20일 점검
레지스트리 이름이 GitHub 계정 redd34 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
코드 마지막 변경: 5일 전
Apache-2.0 사용
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
OSV.dev에 nightshift-grid@0.1.3 항목이 없습니다
이 버전의 패키지 자체만 확인하며 모든 의존성은 아닙니다 · 확인 2026년 11월 15일
제작자라면 이 코드를 README에 붙여 넣으세요. 배지는 이 페이지로 연결됩니다.
[](https://mcp.popnx.com/en/servers/redd34-nightshift-grid)질문하고, 팁을 나누고, 안 되는 점을 알려 주세요. "도움이 됨"이 많은 순서예요.
아직 리뷰가 없어요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
해당하는 기본 점검 3개 중 3개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
GitHub 저장소는 마지막으로 5일 전 변경됐고, 최신 버전(0.1.3)은 5일 전 레지스트리에 올라왔어요.
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Python (uv)도 있어야 해요.
같은 카테고리에는: Puter MCP, XcodeBuildMCP, Vexa, Atlassian Rovo MCP Server, Anki MCP Server
같은 카테고리, 다른 제작자, 명령 확인 완료. 공식이 먼저, 그다음 스타 순.
카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
Puter MCP enables AI tools to interact with Puter: manage files, websites, workers, and more
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Meeting bot and transcripts for Google Meet, Teams and Zoom. Live or after, speakers labelled.
Connect to Atlassian Jira, Confluence, Loom, and more to search, create, and manage your work.
MCP server for Anki flashcards: adaptive review, notes, media, and deck management via AnkiConnect.
| 이 항목 Nightshift Grid | Puter MCP | XcodeBuildMCP | Vexa | Atlassian Rovo MCP Server | Anki MCP Server | |
|---|---|---|---|---|---|---|
| 실행 위치 | 컴퓨터에 설치 필요 | 클라우드에서 동작, 설치 불필요 | 컴퓨터에 설치 필요 | 클라우드에서 동작, 설치 불필요 | 클라우드에서 동작, 설치 불필요 | 컴퓨터에 설치 필요 |
| 키 필요 | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 아니요 |
| Claude에서 +로 추가 | 아니요 | 아니요 | 아니요 | 아니요 | 예 | 아니요 |
| 기본 점검 | 3/3 | 4/4 | 3/3 | 2/4 | 4/4 | 3/3 |
| 라이선스 | Apache-2.0 | AGPL-3.0 | MIT | Apache-2.0 | Apache-2.0 | MIT |
| 가격 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 | 등록 정보에 비용 없음 |
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
Turn idle laptops, office PCs and legacy mini-PCs into a zero-CapEx, fault-tolerant local AI batch and GraphRAG cluster.
pipx install nightshift-grid # or: uv tool install nightshift-grid
nightshift up --mock --workers 3 # coordinator + 3 workers + live dashboard
A real (mock-inference) run recorded with scripts/record_demo.py. Benchmarks so far are from a single Mac; see Known limitations.
Nightshift Grid is a lightweight distributed compute engine ("SETI@home meets local enterprise MapReduce"). It harvests idle cycles across mixed local machines without slowing down the people using them.
It doesn't slice one giant model across slow LAN links, where Wi-Fi jitter destroys token throughput and one closed laptop lid kills the forward pass. Instead, every machine is a preemptible, fenced micro-worker running its own quantized small model (qwen3:4b, qwen2.5:3b, phi4-mini) via Ollama. A central coordinator hands out leased chunks. When a human touches the machine, the node yields immediately and its chunk moves to another node.
submit 24 chunks output_graph.jsonl
client ──────────────────────▶ Coordinator ───────────────────────▶ (1 record / chunk) │ ▲ lease(task_id, lease_id) / heartbeat 3s / complete / preempt ┌───────────────┼──┼────────────────┐ ▼ ▼ │ ▼ node-office-pc node-legacy-laptop node-mac-studio each: worker_daemon.py (Tier 2) (Tier 1) (Tier 3) + local Ollama
Most teams have gigabytes to terabytes of unstructured PDFs, logs and tickets that can't go to cloud APIs for cost or privacy reasons. Meanwhile the office PCs, laptops and mini-PCs that could process them sit mostly idle all day and fully idle overnight.
The common ways to pool local machines leave a gap for batch pipelines:
| Approach | Typical failure mode for batch work | Nightshift Grid |
|---|---|---|
| Tensor/layer splitting (one big model sharded across machines) | Bound by LAN serialization. One node dropping mid-pass stalls the whole request. | Each node runs a whole small model on independent chunks. A dropped node costs one chunk retry. |
| Stateless request routing (load-balance chat requests across nodes) | No durable job state, so a node dying mid-request fails that request. | Stateful MapReduce queue with fenced leases. Every chunk completes or is explicitly dead-lettered. |
| Dedicated inference pools | Machines must be handed over to the cluster. | Good-citizen harvesting: the human always wins and the grid backs off in milliseconds. |
Capability tiers decide what each node gets: Tier 1 (<8GB free) does embeddings and chunking, Tier 2 (8–24GB) does 3B–8B INT4 entity/relationship extraction, and Tier 3 (>24GB, or Apple Silicon with ≥16GB free) does heavy verification and synthesis.
A common trap when wrapping Ollama or llama.cpp in Python is breaking out of the token loop without closing the underlying socket. The server keeps generating, and the GPU stays pegged until the response finishes. A second trap is checking for user activity only when a token arrives. That leaves a blind spot while the model is loading weights or evaluating a long prompt.
Nightshift runs inference in its own asyncio task. An out-of-band activity watcher polls the chaos trigger file every 100ms and OS HID idle time every 500ms: IOKit HIDIdleTime read in-process on macOS (ioreg -c IOHIDSystem as a fallback), GetLastInputInfo on Windows, D-Bus or xprintidle on Linux. On activity it calls task.cancel(), which unwinds async with client.stream(...) and closes the connection, so Ollama stops generating.
Measured with qwen3:4b on Apple Silicon (GPU utilisation from IOKit, 250ms samples):
| Worker cancellation method | GPU utilisation afterwards |
|---|---|
| Stop the read loop, leave the response open | 84–94% until the model finishes |
Error raised inside async with client.stream | 0% by the first sample; next request ready in 0.04s |
Out-of-band task.cancel() (also covers model load and prompt eval) | 0% by the first sample |
Three workers (qwen3:4b, about 130 tok/s decode) processed a 24-chunk industrial-maintenance GraphRAG extraction job per phase, with auth enabled (python nightshift.py chaos-test --model qwen3:4b). All three workers ran on one Mac sharing one Ollama instance. Multi-machine runs are still to do.
| Chaos scenario / metric | Measured result |
|---|---|
Live human preemption (user returns mid-job on node-legacy-laptop) | 24/24 chunks in 47.3s, 0 failures |
| Activity → coordinator reclaims the lease (trigger file, 100ms poll) | 0.01–0.10s across runs (0.011s in the final run) |
| Lease reclaimed → re-assigned to another node | 0.8s |
| Activity → preempted chunk finished on the backup node | 5.2s |
| Work sent to the paused node while the human is active | 0 chunks |
Worker crash (SIGKILL node-office-pc mid-chunk) | 24/24 chunks in 45.8s |
SIGKILL → lease expiry (12s TTL) → re-assigned → done | 11.9s → +1.1s → 16.8s total |
Coordinator crash (SIGKILL coordinator mid-job, 3s outage, restart on same SQLite file) | 24/24 chunks in 46.4s, 24 attempts for 24 chunks (0 wasted) |
| Restart → ready; in-flight leases finished by their original holders | 0.23s; 2/2 |
Host CPU spike (busy-loop on all 16 cores mid-job, --max-host-cpu-pct 65) | 24/24 chunks in 54.4s; all 3 workers yielded (cpu_busy) in 1.9–2.7s, 0 leases while loaded, all resumed 2.1s after the load stopped |
| Unintended preemptions from the grid's own Ollama load (phases 1–3) | 0 |
| Auth (anonymous submit / worker token on client API / forged completion) | 401 / 401 / 401 |
| Output integrity (4 jobs) | 96/96 records, 0 missing, 0 duplicates, 434 triples |
With --native-idle-seconds, detection latency is bounded by the 500ms HID poll rather than the 100ms file poll. The HID path is covered by unit tests and live IOKit and ioreg reads. An end-to-end benchmark with real keyboard input is still to do, because synthesising HID events needs macOS Accessibility permission.
| Guarantee | Mechanism |
|---|---|
| No chunk lost | Every lease has a 12s TTL, extended by 3s heartbeats, and a reaper re-queues expired leases. Preemption and graceful SIGTERM hand leases back immediately. A worker can hold only one lease at a time. |
| Fenced leases (no split-brain) | Each assignment carries a unique lease_id. A partitioned or stalled worker can't heartbeat or complete a lease that was re-issued. The heartbeat reply (lease_valid: false) tells it to abort the zombie compute. |
| Race-free pull and pause | If a human returns while a pull is in flight, the new lease goes straight back. Preempt messages name their lease, so a late one can't revoke a newer lease. A paused node gets no work until it reports idle. |
| Dead-letter protection | Errors and lease expiries count toward MAX_FAILURES=3, after which the chunk is parked as FAILED. Human preemptions don't count as failures. |
| Clean graph output | Ollama structured outputs (a JSON schema) constrain decoding. normalize_extraction() coerces the output to [subject, RELATION, object] and canonicalises relation names (exceeded during → EXCEEDED_DURING) so edges merge across chunks. Reasoning tokens are disabled on thinking models (qwen3). Invalid output is a retryable failure. |
| Idempotent sink | output_graph.jsonl is fsynced per record and deduplicated by task_id, including across a coordinator restart or a failed fsync. Retried completions are no-ops. |
| Capability-aware scheduling | A worker serves the highest tier it's capable of first, so Tier 3 nodes aren't spent on Tier 1 work while Tier 3 work waits. Recovered chunks go to the front of the queue. |
| Survives coordinator crashes | Every state transition is journaled to SQLite (WAL) in one transaction. On restart, queue order, results and dead letters are recovered, and in-flight leases get a fresh TTL so workers that kept computing can still complete them. Workers retry completions for 30s to ride out the restart. About 11k durable transitions/s; a 50k-task job recovers in 0.3s. |
| Least-privilege auth | Separate bearer tokens for workers (/worker/*) and clients (/v1/*), so a compromised laptop can lease work but can't submit jobs or read results. Each worker registration gets a session secret (X-Nightshift-Session), so a live worker's id can't be hijacked. Constant-time comparison. Tokens come from files or env, never argv. Reused token files must be regular, owned by you and 0600 (no symlinks). The coordinator binds loopback by default and refuses a LAN bind without tokens. Browser Origin requests are refused, and in no-auth loopback mode untrusted Host headers are refused too (DNS-rebinding protection). |
| Good citizen beyond the keyboard | Workers also pause on battery power (--allow-battery to opt out) and under thermal throttling (macOS pmset, Linux sensors). They pause when *other* processes push host CPU over --max-host-cpu-pct (default 65; Ollama and co-located workers are excluded; sustain and hysteresis prevent flapping; the full process table is walked only every 30s, with new processes picked up on every 1s poll). They pause when free RAM drops under --min-free-ram-gb (default 2.0), evicting the model with keep_alive: 0; the resume threshold includes the model's size, so unloading can't cause a pause/reload loop. |
| Fail-closed idle sensing | With --native-idle-seconds, a worker that can't read HID idle time refuses to start (--allow-no-idle-sensor overrides). Sensors: macOS IOKit HIDIdleTime in-process (falling back to ioreg), Windows GetLastInputInfo, GNOME/Wayland Mutter and freedesktop ScreenSaver over D-Bus, X11 xprintidle. If a sensor dies at runtime, the worker pauses (idle_sensor_lost) rather than guessing. |
| Zero-config LAN discovery | worker_daemon.py --discover finds the coordinator over UDP broadcast. The reply carries an HMAC proof keyed by the worker token, so a rogue host can't impersonate the coordinator and harvest tokens. Replays fail (fresh nonce), two valid coordinators are an error, and responses are size-capped and rate-limited (not an amplifier). |
| Live vector index (optional) | --qdrant-url adds a Qdrant sink alongside the always-on JSONL. Writes are queued off the event loop, batched, embedded (nomic-embed-text, or a deterministic hash embedder) and upserted idempotently into nightshift_graph. Failures spool to disk and replay, and never fail a completion. One embedder per collection is enforced. |
| Preemption without lost work (Baton relay, opt-in) | With coordinator.py --relay