{"id":47808862,"url":"https://github.com/machinefi/trio-core","last_synced_at":"2026-04-03T18:01:10.276Z","repository":{"id":347137545,"uuid":"1173948967","full_name":"machinefi/trio-core","owner":"machinefi","description":"Real-time vision intelligence engine for Apple Silicon. YOLO counting + VLM scene understanding + auto-calibration. REST API in one command.","archived":false,"fork":false,"pushed_at":"2026-04-03T05:07:10.000Z","size":68341,"stargazers_count":11,"open_issues_count":9,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-03T12:58:23.701Z","etag":null,"topics":["apple-silicon","computer-vision","edge-ai","inference","mlx","object-detection","people-counting","real-time","vlm","yolo"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/trio-core/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/machinefi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-05T23:12:28.000Z","updated_at":"2026-04-03T05:07:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/machinefi/trio-core","commit_stats":null,"previous_names":["machinefi/trio-core","machinefi/trio-edge"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/machinefi/trio-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinefi%2Ftrio-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinefi%2Ftrio-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinefi%2Ftrio-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinefi%2Ftrio-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machinefi","download_url":"https://codeload.github.com/machinefi/trio-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinefi%2Ftrio-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31368156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-silicon","computer-vision","edge-ai","inference","mlx","object-detection","people-counting","real-time","vlm","yolo"],"created_at":"2026-04-03T18:00:34.074Z","updated_at":"2026-04-03T18:01:10.263Z","avatar_url":"https://github.com/machinefi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eTrio Edge\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cstrong\u003eOpen-source camera intelligence for your network\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    ONVIF discovery + RTSP streaming + YOLO detection + VLM scene understanding.\u003cbr\u003e\n    One pip install. Runs on any Mac, Linux, or Windows machine.\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/trio-edge/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/trio-edge?color=blue\" alt=\"PyPI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/trio-edge/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/trio-edge\" alt=\"Python\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/machinefi/trio-edge/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/machinefi/trio-edge\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/machinefi/trio-edge/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/machinefi/trio-edge?style=social\" alt=\"Stars\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e |\n  \u003ca href=\"#two-modes\"\u003eTwo Modes\u003c/a\u003e |\n  \u003ca href=\"#cloud-relay\"\u003eCloud Relay\u003c/a\u003e |\n  \u003ca href=\"#local-ai\"\u003eLocal AI\u003c/a\u003e |\n  \u003ca href=\"#cli\"\u003eCLI\u003c/a\u003e |\n  \u003ca href=\"#api-reference\"\u003eAPI\u003c/a\u003e |\n  \u003ca href=\"#python-sdk\"\u003eSDK\u003c/a\u003e |\n  \u003ca href=\"#architecture\"\u003eArchitecture\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## What is Trio Edge?\n\nTrio Edge is the open-source camera agent for [Trio AI](https://trio.ai). It runs on your local network, discovers cameras via ONVIF, and either:\n\n1. **Relays frames to Trio Cloud** for full AI analysis (memory, entity tracking, dashboards)\n2. **Runs AI locally** with your own LLM (Claude, GPT, local Qwen) for standalone use\n\n```\n┌──────────────────────────────────────────────────────────┐\n│  Your Network                                            │\n│                                                          │\n│  IP Camera ──RTSP──► Trio Edge ──HTTPS──► Trio Cloud     │\n│                      (this repo)         (paid, $99/cam) │\n│                          │                               │\n│                          └── or use your own LLM         │\n│                             (free, open source)          │\n└──────────────────────────────────────────────────────────┘\n```\n\n**Core capabilities:**\n- **Discover** — Auto-find cameras on your network via ONVIF\n- **Relay** — Push RTSP frames to Trio Cloud over HTTPS (NAT-friendly)\n- **Detect** — YOLO v10n object detection (people, vehicles, 80 classes)\n- **Describe** — VLM scene descriptions with any LLM (local or cloud)\n- **Tailscale auto-proxy** — Works through Tailscale networks automatically\n\n---\n\n## Quick Start\n\n```bash\n# Install\npip install 'trio-edge[mlx]'      # Apple Silicon\npip install 'trio-edge[cuda]'     # NVIDIA GPU\npip install trio-edge              # CPU-only\n\n# Discover cameras on your network\ntrio discover\n\n# Start watching a camera\ntrio cam --rtsp rtsp://admin:pass@192.168.1.100/stream\n\n# Or relay to Trio Cloud\ntrio relay --camera rtsp://admin:pass@192.168.1.100/stream \\\n           --cloud https://api.trio.ai --token YOUR_TOKEN\n```\n\n---\n\n## Two Modes\n\n### Mode 1: Cloud Relay (Trio Cloud customers)\n\nTrio Edge pulls RTSP or local video, registers a camera with Trio Cloud, and pushes HTTP MPEG-TS to the cloud ingest endpoint. All AI processing happens in the cloud.\n\n```bash\ntrio relay --camera rtsp://admin:pass@192.168.1.100/stream \\\n           --cloud https://api.trio.ai \\\n           --token YOUR_TOKEN\n```\n\n**What Edge does:** source capture → ffmpeg MPEG-TS mux → authenticated HTTP upload\n**What Cloud does:** session management → ingest → analysis → dashboard\n\n### Mode 2: Local AI (open-source users)\n\nRun everything locally with your own LLM. No cloud needed, no subscription.\n\n```bash\n# With local Qwen model (Apple Silicon)\ntrio cam --rtsp rtsp://admin:pass@192.168.1.100/stream\n\n# With Claude API\nANTHROPIC_API_KEY=sk-xxx trio cam --rtsp rtsp://... --llm claude\n\n# With OpenAI\nOPENAI_API_KEY=sk-xxx trio cam --rtsp rtsp://... --llm gpt-4o\n```\n\n**Note:** Local mode gives you real-time detection and descriptions, but no persistent memory, entity tracking, historical analytics, or dashboard. For those features, use [Trio Cloud](https://trio.ai).\n\n---\n\n## Features\n\n### ONVIF Camera Discovery\n\n```bash\ntrio discover\n# Found 2 camera(s):\n#   [1] Reolink RLC-810A (192.168.1.100)\n#       RTSP: rtsp://192.168.1.100:554/h264Preview_01_main\n#   [2] Hikvision DS-2CD2143 (192.168.1.101)\n#       RTSP: rtsp://192.168.1.101:554/Streaming/Channels/101\n```\n\n### Tailscale Auto-Proxy\n\nIf you use Tailscale, Trio Edge automatically detects when the macOS network extension blocks camera access and creates a transparent TCP proxy:\n\n```\ntrio cam --rtsp rtsp://admin:pass@192.168.1.100/stream\n# Tailscale detected — starting TCP proxy via system Python...\n# Proxy: 127.0.0.1:15554 → 192.168.1.100:554\n# (continues normally, user sees no difference)\n```\n\n### YOLO Object Detection\n\nBuilt-in YOLOv10n (ONNX, 9MB) with tiled detection for accuracy:\n\n```bash\ntrio cam --rtsp rtsp://... --count\n# [14:23:46] People: 3, Vehicles: 2\n# [14:24:12] People: 5, Vehicles: 2 (+2 people)\n```\n\n### VLM Scene Description\n\nSupports multiple VLM backends:\n\n| Backend | Command | Requirements |\n|---------|---------|-------------|\n| Local Qwen (MLX) | `trio cam --rtsp ...` | Apple Silicon, 4GB+ RAM |\n| Claude | `trio cam --llm claude` | `ANTHROPIC_API_KEY` |\n| GPT-4o | `trio cam --llm gpt-4o` | `OPENAI_API_KEY` |\n| Any OpenAI-compatible | `trio cam --llm-url http://...` | API endpoint |\n\n---\n\n## CLI\n\n```bash\ntrio discover                          # Find cameras via ONVIF\ntrio cam --rtsp rtsp://... --count     # Watch + count objects\ntrio cam --host 192.168.1.100 -p pass  # Auto-discover + connect\ntrio relay --camera rtsp://... --cloud https://api.trio.ai  # Cloud relay\ntrio serve                             # Start inference API server\ntrio analyze photo.jpg -q \"What's here?\"  # Analyze single image\ntrio webcam -w \"person at the door\"    # Webcam with alerts\ntrio doctor                            # Diagnose setup issues\ntrio device                            # Show hardware info\n```\n\n---\n\n## API Reference\n\nStart the local inference server:\n\n```bash\ntrio serve                          # default: 0.0.0.0:8100\ntrio serve --port 9000              # custom port\nTRIO_API_KEY=secret trio serve      # enable auth\n```\n\n### `POST /api/inference/detect`\n\nYOLO object detection.\n\n```bash\ncurl -X POST http://localhost:8100/api/inference/detect \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image_b64\": \"'$(base64 -i photo.jpg)'\"}'\n```\n\n```json\n{\n  \"people_count\": 3, \"vehicle_count\": 1,\n  \"by_class\": {\"person\": 3, \"car\": 1},\n  \"crops_b64\": [{\"class\": \"person\", \"bbox\": [100, 50, 200, 300], \"confidence\": 0.92}],\n  \"elapsed_ms\": 45\n}\n```\n\n### `POST /api/inference/describe`\n\nVLM scene description.\n\n```bash\ncurl -X POST http://localhost:8100/api/inference/describe \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"image_b64\": \"'$(base64 -i photo.jpg)'\", \"prompt\": \"Describe what you see.\"}'\n```\n\n### `POST /api/inference/crop-describe`\n\nCombined: YOLO detects → crop → VLM describes each entity → full scene description.\n\n---\n\n## Python SDK\n\n```python\nfrom trio_edge import TrioCore, EngineConfig\n\nengine = TrioCore()\nengine.load()\n\nresult = engine.analyze_video(\"photo.jpg\", \"What do you see?\")\nprint(result.text)\n```\n\n---\n\n## Supported Models\n\n### Tier 1 — Full optimization (native loading + visual token compression + KV reuse)\n\n| Model | Params | 4-bit VRAM | Best for |\n|---|---|---|---|\n| Qwen3-VL-8B | 8B | ~5GB | **Recommended** — best accuracy |\n| Qwen2.5-VL-3B | 3B | ~2GB | Fast, lightweight |\n| Qwen3.5 | 0.8-9B | 0.5-5G | Flexible range |\n| InternVL3 | 1-2B | 1-1.6G | Tiny devices |\n\n### Tier 2 — Inference only (via mlx-vlm)\n\nGemma 3n, SmolVLM2, Phi-4, FastVLM, and any model supported by mlx-vlm.\n\n---\n\n## Architecture\n\n```\n                          Trio Edge\n                              |\n              +---------------+---------------+\n              |                               |\n         YOLO Pipeline                   VLM Pipeline\n              |                               |\n    YOLOv10n ONNX (9MB)            Qwen/Claude/GPT/any LLM\n    tiled 2x2 detection              native MLX loading\n    ByteTrack tracking               ToMe token compression\n              |                       KV cache reuse\n              |                               |\n              +---------------+---------------+\n                              |\n              +-------+-------+-------+\n              |       |       |       |\n          /detect  /describe  /crop   Relay\n                              -describe  to Cloud\n```\n\n### Trio Cloud integration\n\nWhen connected to Trio Cloud, Edge is just a lightweight relay:\n\n```\nCamera → Edge (RTSP pull + compress) → Trio Cloud (all AI in cloud)\n```\n\nEdge sends ~50-100 KB/s per camera. No GPU needed on the edge device.\n\n---\n\n## Configuration\n\n| Variable | Default | Description |\n|---|---|---|\n| `TRIO_MODEL` | `Qwen3-VL-8B-4bit` | HuggingFace model ID |\n| `TRIO_YOLO_MODEL` | (auto-downloaded) | Path to YOLO ONNX model |\n| `TRIO_API_KEY` | (none) | Bearer token for API auth |\n| `TRIO_CLOUD_URL` | (none) | Trio Cloud API URL for relay mode |\n| `TRIO_CLOUD_TOKEN` | (none) | Trio Cloud auth token |\n\nSee [`src/trio_edge/config.py`](src/trio_edge/config.py) for all options.\n\n---\n\n## Troubleshooting\n\n| Problem | Solution |\n|---|---|\n| `trio discover` finds no cameras | Make sure cameras are on the same subnet. Some routers block multicast. |\n| Camera found but can't connect | Check username/password. Try `trio cam --rtsp rtsp://admin:pass@IP/stream` directly. |\n| Tailscale blocking camera access | Trio Edge auto-detects this and creates a proxy. If it doesn't work, try `trio doctor`. |\n| First run slow | Model download (~2-5 GB). Subsequent runs start instantly. |\n| Out of memory | Use a smaller model: `TRIO_MODEL=mlx-community/Qwen2.5-VL-3B-Instruct-4bit` |\n\nRun `trio doctor` to diagnose most issues.\n\n---\n\n## License\n\nApache 2.0 — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinefi%2Ftrio-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachinefi%2Ftrio-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinefi%2Ftrio-core/lists"}