{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "goccy-go-llama--embed-gguf-model-in-go-service",
 "repo": "goccy/go-llama",
 "repo_url": "https://github.com/goccy/go-llama",
 "repo_slug": "goccy-go-llama",
 "title": "Add local GGUF text generation to a Go program",
 "page_title": "How to add local GGUF text generation to a Go program with Go Llama",
 "summary": "Call a local GGUF model from Go code and get generated text back, with no cgo.",
 "who": "A Go backend developer who needs text generation in a service and wants to avoid cgo or a separate inference server.",
 "problem": "Calling a hosted model API adds a network dependency, and cgo-based bindings complicate builds and cross-compiling.",
 "outcome": "A Go program that loads a GGUF file, generates text from a prompt, and prints the result.",
 "steps": [
  "Install a Go toolchain and download a GGUF model file to your machine.",
  "Run `go get github.com/goccy/go-llama` in your Go module. (inferred, check the README)",
  "Copy the README example into main.go and set the LoadModel path to your model file.",
  "Run `CGO_ENABLED=0 go run .` to build and run without cgo. (inferred, check the README)"
 ],
 "agent_prompt": "In the Go module at <project-path>, add the goccy/go-llama package and use the README example to load <model-file>.gguf and generate text from the prompt \"Once upon a time\". Expected output: the generated text printed to stdout. Verify that the program exits without error when built with CGO_ENABLED=0.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The README example uses a model file named model.gguf, and generation speed and memory use depend on the model size and quantization you choose.",
 "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": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/goccy-go-llama/embed-gguf-model-in-go-service/",
 "md": "https://dedupedai.com/use-cases/goccy-go-llama/embed-gguf-model-in-go-service/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--embed-gguf-model-in-go-service.json",
 "api_version": "v1"
}
