{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "edge0-ai-edge0--embed-edge0-in-a-python-app",
 "repo": "Edge0-AI/Edge0",
 "repo_url": "https://github.com/Edge0-AI/Edge0",
 "repo_slug": "edge0-ai-edge0",
 "title": "Embed a streaming MoE engine in your Python app",
 "page_title": "How to embed a streaming MoE engine in your Python app with Edge0",
 "summary": "Use AutoEngine and ChatSession to run Edge0 inside your own code instead of a separate server.",
 "who": "A Python developer building a local assistant or tool on Apple Silicon.",
 "problem": "Calling a separate server adds moving parts when you only need inference inside one app.",
 "outcome": "Your app loading an Edge0 model with AutoEngine, running chat requests and releasing memory cleanly.",
 "steps": [
  "Install edge0 in your environment",
  "Load a model with `AutoEngine.from_pretrained(\"/path/to/model\")`; the tier is detected automatically",
  "Build a ChatRequest with your messages and max_tokens",
  "Run it with ChatSession and decode the tokens",
  "Call `engine.close()` to release mmaps and the expert cache"
 ],
 "agent_prompt": "Write a small Python CLI with Edge0-AI/Edge0's AutoEngine and ChatSession that answers questions about files in <folder>, streams the answer, and always closes the engine on exit.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Advanced",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "This card is written from the Edge0-AI/Edge0 README, not from a test run by Deduped. Before you start, make sure you have Python 3.12 on macOS with Apple Silicon for the Python framework. Check the repo for newer instructions before you rely on these steps.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.12 on macOS with Apple Silicon for the Python framework (MLX)",
  "Disk space for the model checkpoints from Hugging Face or ModelScope",
  "Native apps for macOS, iOS, Android and Windows live in their own directories"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/edge0-ai-edge0/embed-edge0-in-a-python-app/",
 "md": "https://dedupedai.com/use-cases/edge0-ai-edge0/embed-edge0-in-a-python-app/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/edge0-ai-edge0--embed-edge0-in-a-python-app.json",
 "api_version": "v1"
}
