{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "ollama-ollama--call-local-model-from-python-or-js",
 "repo": "ollama/ollama",
 "repo_url": "https://github.com/ollama/ollama",
 "repo_slug": "ollama-ollama",
 "title": "Call a local model from Python or JavaScript",
 "page_title": "Ollama API: call a local model from Python or JavaScript",
 "summary": "Use the REST API on port 11434 or the official libraries in your app.",
 "who": "A backend developer prototyping an AI feature without API costs.",
 "problem": "Cloud APIs cost money during development.",
 "outcome": "Your code calling a local model.",
 "steps": [
  "Start Ollama and pull a model",
  "Test with curl against http://localhost:11434/api/chat",
  "Install `pip install ollama` or `npm i ollama`",
  "Call chat with your model and messages"
 ],
 "agent_prompt": "Using the ollama Python library, send <prompt> to gemma4 and print the reply. Confirm the request went to localhost:11434.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "15 minutes",
 "basis": "readme",
 "caveat": "The API listens on localhost by default.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "macOS, Windows, Linux or Docker",
  "Enough RAM or VRAM for the model you pick"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ollama-ollama/call-local-model-from-python-or-js/",
 "md": "https://dedupedai.com/use-cases/ollama-ollama/call-local-model-from-python-or-js/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/ollama-ollama--call-local-model-from-python-or-js.json",
 "api_version": "v1"
}
