{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "goccy-go-llama--run-untrusted-gguf-in-sandbox",
 "repo": "goccy/go-llama",
 "repo_url": "https://github.com/goccy/go-llama",
 "repo_slug": "goccy-go-llama",
 "title": "Run a third-party GGUF model with limited file and memory access",
 "page_title": "How to run a third-party GGUF model with limited file and memory access with Go Llama",
 "summary": "Restrict the model to one directory and cap its memory using llama.New options.",
 "who": "A security-minded engineer who must run a model file from an outside source on a shared server.",
 "problem": "An unknown model file should not be able to see the whole filesystem or grow memory without limit.",
 "outcome": "The guest can read only the chosen model directory, and an oversized model fails inside the sandbox.",
 "steps": [
  "Place the model file in one dedicated directory such as /srv/models.",
  "Pass llama.WithPreopenDir with that directory to llama.New.",
  "Set a memory limit with llama.WithMaxMemory to cap growth.",
  "Run `go run .` and confirm an oversized model fails with an error instead of growing the host process. (inferred, check the README)"
 ],
 "agent_prompt": "In the Go project at <project-path>, create a llama.New instance with WithPreopenDir set to /srv/models and WithMaxMemory set to a limit you choose, then load <model-file>.gguf. Expected output: a successful load for a small model and an error for a model larger than the cap. Verify that the program cannot open files outside /srv/models.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The README describes these sandbox options, but it does not say how strictly the limits are enforced, so test them against your own threat model before trusting them.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "A Go toolchain installed on your machine",
  "A GGUF model file, such as model.gguf",
  "Enough memory for the model weights and KV cache, since the README notes wasm32 caps linear memory at 4 GiB"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/goccy-go-llama/run-untrusted-gguf-in-sandbox/",
 "md": "https://dedupedai.com/use-cases/goccy-go-llama/run-untrusted-gguf-in-sandbox/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/goccy-go-llama--run-untrusted-gguf-in-sandbox.json",
 "api_version": "v1"
}
