{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "bentoml-openllm--serve-llama-3-2-as-an-openai-compatible-api-with-openllm",
 "repo": "bentoml/OpenLLM",
 "repo_url": "https://github.com/bentoml/OpenLLM",
 "repo_slug": "bentoml-openllm",
 "title": "Serve Llama 3.2 as an OpenAI compatible API",
 "page_title": "How to serve Llama 3.2 as an OpenAI compatible API with OpenLLM",
 "summary": "Run openllm serve on llama3.2:1b and point the OpenAI Python client at localhost:3000/v1.",
 "who": "A developer whose app already uses the OpenAI client and wants a self hosted model.",
 "problem": "Switching an app to a local model usually means rewriting its API calls.",
 "outcome": "A local server at http://localhost:3000/v1 that the OpenAI client can call unchanged.",
 "steps": [
  "Install with `pip install openllm`",
  "Set a Hugging Face token if the model is gated, as the README describes",
  "Start the server with `openllm serve llama3.2:1b`",
  "Create an OpenAI client with base_url http://localhost:3000/v1 and send a chat completion",
  "Swap the base URL in your own app to use the local model"
 ],
 "agent_prompt": "Using bentoml/OpenLLM, run `openllm serve llama3.2:1b`, then write a Python script with the OpenAI client and base_url 'http://localhost:3000/v1' that streams an answer to <my question>.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Beginner",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "Gated models such as Llama need a Hugging Face token before they download.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python with pip",
  "A GPU sized for the model you pick",
  "A Hugging Face token for gated models"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "download",
   "notice": "Model weights download on first serve."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/bentoml-openllm/serve-llama-3-2-as-an-openai-compatible-api-with-openllm/",
 "md": "https://dedupedai.com/use-cases/bentoml-openllm/serve-llama-3-2-as-an-openai-compatible-api-with-openllm/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/bentoml-openllm--serve-llama-3-2-as-an-openai-compatible-api-with-openllm.json",
 "api_version": "v1"
}
