{"id":118185,"date":"2024-10-29T14:12:23","date_gmt":"2024-10-29T14:12:23","guid":{"rendered":"\/tutorials\/?p=118185"},"modified":"2026-06-25T09:32:53","modified_gmt":"2026-06-25T09:32:53","slug":"ollama-cli-tutorial","status":"publish","type":"post","link":"\/in\/tutorials\/ollama-cli-tutorial","title":{"rendered":"Ollama CLI tutorial: How to use Ollama in the terminal"},"content":{"rendered":"<p>The Ollama CLI is the command-line interface for downloading, running, managing, customizing, and connecting local AI models from your terminal.<\/p><p>With the CLI, you can chat with models, send single prompts, customize model behavior with a Modelfile, expose a local API, automate tasks with scripts, and connect Ollama to coding tools and cloud models.<\/p><p>Using Ollama from the terminal involves five main stages:<\/p><ol class='\"wp-block-list\" wp-block-list'>\n<li>Install Ollama and confirm it responds from the command line.<\/li>\n\n\n\n<li>Download, run, and manage models on your machine.<\/li>\n\n\n\n<li>Pass files and prompts to models, save responses, and create embeddings.<\/li>\n\n\n\n<li>Customize model behavior with a Modelfile.<\/li>\n\n\n\n<li>Serve a local API and use Ollama with Python, scripts, cron jobs, and coding tools.<\/li>\n<\/ol><p><\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-what-is-the-ollama-cli\"><strong>What is the Ollama CLI?<\/strong><\/h2><p>The Ollama CLI is the terminal layer for controlling local AI models and the <a href=\"\/in\/tutorials\/what-is-ollama\/\">Ollama<\/a> service that runs them. It lets you manage models with short, scriptable commands instead of clicking through a window.<\/p><p>From the command line, you can pull models, run chats or one-off prompts, list and inspect installed models, remove models, build custom models, start the local server, launch integrations, and sign in to use cloud models. Each command talks to the Ollama service running in the background.<\/p><p>The CLI installs with Ollama, so you don&rsquo;t need to set up anything else once Ollama is on your machine. The same commands work across Linux, macOS, and Windows.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-install-and-verify-ollama-in-the-terminal\"><strong>How to install and verify Ollama in the terminal<\/strong><\/h2><p>CLI commands only work after you <a href=\"\/in\/tutorials\/how-to-install-ollama\/\">install Ollama<\/a>, so install it first if you haven&rsquo;t already. The installer also adds the <strong>ollama<\/strong> command to your system path.<\/p><p>Installation differs slightly by operating system:<\/p><ul class='\"wp-block-list\" wp-block-list'>\n<li>Linux. Run the official install script, <strong>curl -fssl https:\/\/ollama.com\/install.sh | sh<\/strong>.<\/li>\n\n\n\n<li>macOS. Download the macOS app from <strong>ollama.com<\/strong>. Homebrew, <strong>brew install ollama<\/strong>, also works, but it&rsquo;s a community-maintained method, not the primary official installer.<\/li>\n\n\n\n<li>Windows. Download and run the official installer from <strong>ollama.com<\/strong>.<\/li>\n<\/ul><p>Once the installation finishes, confirm the version from a terminal:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama --version<\/pre><p>Running <strong>ollama<\/strong> on its own opens the interactive menu, where you can pick a model to run, launch a tool, or browse integrations. Use the arrow keys, <strong>&uarr;\/&darr;<\/strong>, to move the selection, <strong>&rarr;<\/strong> to change the model, <strong>Enter<\/strong> to launch, and <strong>\/bye<\/strong> to quit:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama<\/pre><figure data-wp-context='{\"imageId\":\"6a5232165cd78\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a5232165cd78\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-verify-version.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' output of the ollama command showing version class='\"wp-image-151693\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>To see every command and its flags, use the built-in help:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama help<\/pre><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-ollama-cli-commands-cheat-sheet\"><strong>Ollama CLI commands cheat sheet<\/strong><\/h2><p>The following table lists the Ollama CLI commands you&rsquo;ll use most often, from everyday tasks to advanced workflows. Use it as a quick reference before practicing real tasks in the terminal.<\/p><figure tabindex=\"0\" class='\"wp-block-table\"'><table><tbody><tr><td><strong>Command<\/strong><\/td><td><strong>What it does<\/strong><\/td><td><strong>When to use it<\/strong><\/td><\/tr><tr><td><strong>ollama run model-name<\/strong><\/td><td>Starts a model in an interactive session and pulls it first if needed.<\/td><td>Chatting with a model or sending a quick prompt.<\/td><\/tr><tr><td><strong>ollama pull model-name<\/strong><\/td><td>Downloads a model to your machine.<\/td><td>Getting a model before the first run.<\/td><\/tr><tr><td><strong>ollama list<\/strong> or <strong>ollama ls<\/strong><\/td><td>Lists the models stored locally.<\/td><td>Checking what&rsquo;s installed and how much space it uses.<\/td><\/tr><tr><td><strong>ollama show model-name<\/strong><\/td><td>Shows a model&rsquo;s architecture, parameters, and license.<\/td><td>Inspecting a model before customizing or deleting it.<\/td><\/tr><tr><td><strong>ollama ps<\/strong><\/td><td>Lists models currently loaded in memory.<\/td><td>Seeing what&rsquo;s running and how much memory it uses.<\/td><\/tr><tr><td><strong>ollama stop model-name<\/strong><\/td><td>Unloads a running model from memory.<\/td><td>Freeing memory without deleting the model.<\/td><\/tr><tr><td><strong>ollama rm model-name<\/strong><\/td><td>Deletes a downloaded model from disk.<\/td><td>Reclaiming disk space.<\/td><\/tr><tr><td><strong>ollama create model-name -f .\/modelfile<\/strong><\/td><td>Builds a custom model from a Modelfile.<\/td><td>Saving a reusable model with set behavior.<\/td><\/tr><tr><td><strong>ollama serve<\/strong><\/td><td>Starts the local API server.<\/td><td>Connecting Ollama to apps, scripts, or the API.<\/td><\/tr><tr><td><strong>ollama launch<\/strong><\/td><td>Configures and opens a supported tool with an Ollama model.<\/td><td>Connecting Ollama to a coding tool or assistant.<\/td><\/tr><tr><td><strong>ollama signin<\/strong><\/td><td>Signs in to your <strong>ollama.com<\/strong> account.<\/td><td>Using cloud models or account features.<\/td><\/tr><tr><td><strong>ollama signout<\/strong><\/td><td>Signs out of your <strong>ollama.com<\/strong> account.<\/td><td>Ending a cloud session.<\/td><\/tr><\/tbody><\/table><\/figure><p>Replace <strong>model-name<\/strong> with the model you want to use, such as <strong>gemma3<\/strong>.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-download-and-run-models-with-the-ollama-cli\"><strong>How to download and run models with the Ollama CLI<\/strong><\/h2><p>To run a model with the Ollama CLI, download it with <strong>ollama pull<\/strong> and start it with <strong>ollama run<\/strong>. Running a model that isn&rsquo;t installed yet pulls it automatically, so <strong>ollama run<\/strong> alone is often enough.<\/p><p>Pull a model by name:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama pull gemma3<\/pre><figure data-wp-context='{\"imageId\":\"6a5232165f3c7\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a5232165f3c7\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-pull-gemma3.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' showing ollama pull gemma3 downloading the gb model to success class='\"wp-image-151688\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>Plain <strong>gemma3<\/strong> pulls the <strong>4B<\/strong> model, which is about <strong>3.3 GB<\/strong> and handles both text and images. On a machine with limited memory, <strong>gemma3:1b<\/strong> is around <strong>815 MB<\/strong>, supports text only, and runs on a CPU without a dedicated GPU.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to run a one-off prompt<\/strong><\/h3><p>A one-off prompt runs a single instruction and returns the answer without opening a session. Pass the prompt as a quoted string after the model name:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run gemma3 \"Explain what a cron job does in one paragraph.\"<\/pre><figure data-wp-context='{\"imageId\":\"6a52321661968\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a52321661968\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-one-off-prompt-scaled.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' running a one-off gemma3 prompt explaining what cron job does class='\"wp-image-151687\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>One-off prompts work well for scripts, quick lookups, and terminal workflows because they print the answer and exit right away. That makes them easy to combine with other commands or save to a file.<\/p><p>This method works for every model in the library. To use the same approach with a reasoning model, <a href=\"\/in\/tutorials\/how-to-set-up-deepseek-with-ollama\/\">set up DeepSeek with Ollama<\/a>.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to start an interactive Ollama chat<\/strong><\/h3><p>An interactive Ollama chat starts when you run a model without a prompt. The session keeps the conversation context, so you can ask follow-up questions.<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run gemma3<\/pre><p>Inside the session, type a prompt and press <strong>Enter<\/strong>. For example, you can ask the model to explain a command before you run it:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>Explain what the command find . -name \"*.log\" -mtime +7 -delete does.<\/pre><figure data-wp-context='{\"imageId\":\"6a52321663d5c\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a52321663d5c\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-interactive-chat.png\/w=1024,h=1024,fit=scale-down\" alt='\"Interactive' gemma3 chat session explaining a find command in the terminal class='\"wp-image-151684\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>A few slash commands help you manage the session:<\/p><ul class='\"wp-block-list\" wp-block-list'>\n<li><strong>\/bye<\/strong> ends the session and returns you to the terminal.<\/li>\n\n\n\n<li><strong>\/clear<\/strong> clears the current context, so the model forgets the conversation so far.<\/li>\n\n\n\n<li><strong>\/help<\/strong> lists the available session commands.<\/li>\n<\/ul><p>The model remembers the conversation only while the session is open. If you exit then start a new session, it has no memory of the previous chat.<\/p><p>If you want consistent behavior across sessions, define it in a Modelfile instead of relying on chat history.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to use multiline prompts<\/strong><\/h3><p>Multiline prompts let you send long or structured input at once, such as a pasted log, a configuration block, or multi-step instructions. Inside a session, wrap the text in triple quotes:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>&gt;&gt;&gt; \"\"\"\n... Review this NGINX location block and flag any problem:\n... location \/api {\n...    proxy_pass http:\/\/localhost:3000;\n... }\n... \"\"\"<\/pre><p>The model treats everything between the opening and closing triple quotes as a single prompt. This is cleaner than forcing a long instruction onto one line.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to use multimodal models in Ollama CLI<\/strong><\/h3><p>The Ollama CLI supports multimodal prompts with vision-capable models, so you can ask about an image directly from the terminal. Add the image file path to the prompt, and the model reads it as input:<\/p><p>ollama run gemma3 &ldquo;Describe what is shown in this screenshot: \/home\/user\/screenshot.png&rdquo;<\/p><p>The default <strong>gemma3<\/strong> model handles images, while the smaller <strong>gemma3:1b<\/strong> model supports text only. Pull the <strong>4B<\/strong> model or a larger version for visual tasks.<\/p><p>A graphical interface often works better for repeated image tasks, but the CLI handles one-off image prompts well.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-manage-local-ollama-models\"><strong>How to manage local Ollama models<\/strong><\/h2><p>The Ollama CLI manages local models with commands that list, inspect, stop, and remove model files on your machine. You&rsquo;ll use these commands after running a model when you need to check storage or free up memory.<\/p><p>Each command works with models already downloaded to your system.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to list installed models<\/strong><\/h3><p>List installed models with <strong>ollama list<\/strong> or its shorter alias, <strong>ollama ls<\/strong>. Both commands print the same table:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama list<\/pre><figure data-wp-context='{\"imageId\":\"6a52321666800\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a52321666800\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-list-models.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' showing ollama list with gemma3:latest its id size and date class='\"wp-image-151686\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>The output shows each model&rsquo;s name, size on disk, and last modified date. Check the size column when disk space runs low because larger models can take up several gigabytes each.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to inspect model details<\/strong><\/h3><p>Inspect a model&rsquo;s details with <strong>ollama show<\/strong>. It prints the model&rsquo;s architecture, parameters, context length, and license:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama show gemma3<\/pre><figure data-wp-context='{\"imageId\":\"6a52321668c36\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a52321668c36\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-running-models.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' showing ollama ps with gemma3 loaded in memory at cpu class='\"wp-image-151690\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>To see the exact recipe behind a model, add the <strong>&ndash;modelfile<\/strong> flag:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama show --modelfile gemma3<\/pre><p>Use this before customizing or deleting a model, so you know its template and parameters first. The <strong>&ndash;modelfile<\/strong> output also gives you a useful starting point when you build your own model.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to stop or remove models<\/strong><\/h3><p>Stop a running model with <strong>ollama stop<\/strong>, and delete a downloaded model with <strong>ollama rm<\/strong>. Check what&rsquo;s currently running first:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama ps<\/pre><p>Stopping unloads the model from memory but keeps it on disk:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama stop gemma3<\/pre><p>Removing deletes the model files from disk:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama rm gemma3<\/pre><p>Deleting a model frees disk space, but you&rsquo;ll need to download it again before the next run. Stop a model when you only want to free memory, and remove it when you no longer need the files.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-use-files-outputs-and-embeddings-in-the-ollama-cli\"><strong>How to use files, outputs, and embeddings in the Ollama CLI<\/strong><\/h2><p>The Ollama CLI reads prompt input from files, writes responses to files, and generates embeddings through standard terminal redirection and pipes.<\/p><p>The model reads from standard input and writes to standard output, so the usual shell operators work without extra setup.<\/p><p>Four shell features cover most file and output workflows:<\/p><ul class='\"wp-block-list\" wp-block-list'>\n<li><strong>&lt; input.txt<\/strong> sends a file&rsquo;s contents to the model as input.<\/li>\n\n\n\n<li><strong>&gt; output.txt<\/strong> writes the response to a file and overwrites anything already there.<\/li>\n\n\n\n<li><strong>&gt;&gt; output.txt<\/strong> appends the response to the end of an existing file.<\/li>\n\n\n\n<li><strong>|<\/strong> pipes the output of another command straight into Ollama.<\/li>\n<\/ul><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to prompt Ollama with a local file<\/strong><\/h3><p>Prompt Ollama with a local file by redirecting the file into the command with <strong>&lt;<\/strong>. The model reads the file and acts on it, so you don&rsquo;t need to paste long text into the terminal:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run gemma3 \"Summarize this server log and list the three most frequent errors:\" &lt; error.log<\/pre><p>This works well for long documents, configuration files, and log files. The instruction in quotes tells the model what to do, and the file after <strong>&lt;<\/strong> supplies the content.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to save Ollama responses to a file<\/strong><\/h3><p>Save Ollama responses to a file by redirecting the output with <strong>&gt;<\/strong> or <strong>&gt;&gt;<\/strong>. The first operator overwrites the file, while the second appends to it:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run gemma3 \"List three common Linux server hardening steps.\" &gt; hardening-notes.txt<\/pre><figure data-wp-context='{\"imageId\":\"6a5232166b2d6\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a5232166b2d6\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-save-output-file.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' showing the saved hardening-notes.txt with linux server hardening steps class='\"wp-image-151691\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>Use <strong>&gt;&gt;<\/strong> when you want to keep adding to the same file across several runs:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run gemma3 \"Add three more hardening steps for SSH.\" &gt;&gt; hardening-notes.txt<\/pre><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to generate embeddings from the terminal<\/strong><\/h3><p>Generate embeddings from the terminal by running an embedding model, which returns a numerical vector instead of text.<\/p><p>Embeddings turn text into numbers that capture meaning. They power semantic search, clustering, and retrieval-augmented generation (RAG).<\/p><p>Run an embedding model and pass it some text. Ollama pulls the model automatically on the first run:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run embeddinggemma \"How do I reset a user password on Linux?\"<\/pre><p>The output is a JSON array of numbers instead of a sentence. For larger or repeated workloads, use the <strong>\/api\/embed<\/strong> endpoint or the Python library, which is faster than the interactive command.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-customize-ollama-models-with-a-modelfile\"><strong>How to customize Ollama models with a Modelfile<\/strong><\/h2><p>A Modelfile is the blueprint for building and sharing a customized Ollama model. It combines a base model with a system message, parameters, and a prompt template into a new model you can run by name.<\/p><p>A Modelfile customizes how a model behaves. It doesn&rsquo;t train the model on new data. Real fine-tuning trains LoRA adapters with external tools such as llama.cpp or Unsloth.<\/p><p>The <strong>ADAPTER<\/strong> instruction in a Modelfile applies those pre-trained adapters to a base model. That&rsquo;s a separate workflow beyond system prompts and parameters.<\/p><p>The value of a Modelfile is persistence. Settings you&rsquo;d otherwise retype in every session become part of a reusable model instead.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>What a Modelfile controls<\/strong><\/h3><p>A Modelfile controls the base model, behavior, runtime parameters, and prompt template. These four instructions cover most customizations:<\/p><figure tabindex=\"0\" class='\"wp-block-table\"'><table><tbody><tr><td><strong>Instruction<\/strong><\/td><td><strong>Controls<\/strong><\/td><\/tr><tr><td><strong>FROM<\/strong><\/td><td>The base model the custom model builds on.<\/td><\/tr><tr><td><strong>PARAMETER<\/strong><\/td><td>Runtime behavior, such as temperature, context window size, and stop sequences.<\/td><\/tr><tr><td><strong>SYSTEM<\/strong><\/td><td>The model&rsquo;s role and default behavior.<\/td><\/tr><tr><td><strong>TEMPLATE<\/strong><\/td><td>How the prompt is structured before it reaches the model.<\/td><\/tr><\/tbody><\/table><\/figure><p>Edit <strong>TEMPLATE<\/strong> only if you understand the target model&rsquo;s prompt format, since the wrong template can break how the model responds.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to create and run a custom Ollama model<\/strong><\/h3><p>Create a custom model by writing a Modelfile, then build it with <strong>ollama create<\/strong>. Open a <a href=\"\/in\/tutorials\/how-to-install-and-use-nano-text-editor\/\">text editor such as nano<\/a> and create a file named <strong>modelfile<\/strong>:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>nano modelfile<\/pre><p>Add a base model, a parameter, and a system message:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>FROM gemma3\nPARAMETER temperature 0.5\nSYSTEM \"\"\"You are a Linux server administration assistant. Answer only questions about Linux and server management.\"\"\"<\/pre><p>Save and close the file by pressing <strong>Ctrl+X &rarr; Y &rarr; Enter<\/strong>.<\/p><p>Build the model from that file and give it a name, such as <strong>linux-admin<\/strong>:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama create linux-admin -f .\/modelfile<\/pre><figure data-wp-context='{\"imageId\":\"6a5232166d7cc\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a5232166d7cc\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-create-custom-model.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' running ollama create linux-admin to build a custom model class='\"wp-image-151682\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>Run the custom model the same way as any other model:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama run linux-admin<\/pre><p>The new model applies your system message and parameters every time it runs. To copy and tweak an existing model&rsquo;s setup, start from its recipe with <strong>ollama show &ndash;modelfile gemma3<\/strong>.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-use-ollama-as-a-local-api-server\"><strong>How to use Ollama as a local API server<\/strong><\/h2><p>Ollama runs as a local API server, so applications, scripts, and development tools can send requests to your models without using the interactive prompt. The server listens on <strong>http:\/\/localhost:11434<\/strong>.<\/p><p>Most API endpoints use <strong>\/api<\/strong>, such as <strong>\/api\/generate<\/strong> and <strong>\/api\/chat<\/strong>. The root URL also responds, so you can use it for a basic connectivity check.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to start the Ollama server<\/strong><\/h3><p>Start the Ollama server with <strong>ollama serve<\/strong>, but most installs already run it for you. The official installers on Linux, macOS, and Windows run Ollama as a background service, so on <a href=\"\/vps\">VPS hosting<\/a> or a desktop the API is already listening on <strong>http:\/\/localhost:11434<\/strong>.<\/p><p>Run the command yourself only when no service is running, such as in a container or a minimal setup without systemd, or after you stop the service:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama serve<\/pre><p>If it answers with <strong>address already in use<\/strong>, Ollama is already running.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to test the Ollama API with curl<\/strong><\/h3><p>Test the Ollama API with a <strong>curl<\/strong> request to the <strong>\/api\/generate<\/strong> endpoint, which handles single-turn prompts:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>curl http:\/\/localhost:11434\/api\/generate -d '{\n   \"model\": \"gemma3\",\n   \"prompt\": \"Explain what a reverse proxy does in two sentences.\",\n   \"stream\": false\n}'<\/pre><p>The <strong>model<\/strong> field picks the model, <strong>prompt<\/strong> is the input, and <strong>stream<\/strong> set to <strong>false<\/strong> returns the full response in one object instead of a stream. For multi-turn conversations, send a <strong>messages<\/strong> array to the <strong>\/api\/chat<\/strong> endpoint instead.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to call Ollama from Python<\/strong><\/h3><p>Call Ollama from Python with the official Ollama library, which wraps the API in a few lines. <a href=\"\/in\/tutorials\/install-pip-in-ubuntu\/\">Install pip on Ubuntu<\/a> first if Python and <strong>pip<\/strong> are not set up yet.<\/p><p>Create and activate a virtual environment, then install the library inside it:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>sudo apt install python3-venv -y\npython3 -m venv ollama-env\nsource ollama-env\/bin\/activate\npip install ollama<\/pre><p>Open <strong>nano <\/strong>to create a new file:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>nano chat.py<\/pre><p>Paste the following lines. Use <strong>ollama.chat()<\/strong> for conversations and <strong>ollama.generate()<\/strong> for single prompts:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>from ollama import chat\nfrom ollama import ChatResponse\n\nresponse: ChatResponse = chat(\n    model=\"gemma3\",\n    messages=[{\"role\": \"user\", \"content\": \"Explain what a reverse proxy does in two sentences.\"}],\n)\nprint(response.message.content)<\/pre><p>Save and exit <strong>nano<\/strong>, then run the file while the environment is active:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>python3 chat.py<\/pre><figure data-wp-context='{\"imageId\":\"6a5232166fdc7\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a5232166fdc7\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-python-script-scaled.png\/w=1024,h=1024,fit=scale-down\" alt='\"Terminal' running python3 chat.py in a venv printing reverse proxy answer class='\"wp-image-151689\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>Type <strong>deactivate<\/strong> when you are done, and run the <strong>source<\/strong> line again next time you use the script.<\/p><p>Ollama also provides an official JavaScript library that works the same way. If you need to call the CLI from Python instead of the API, use <strong>subprocess<\/strong>:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>import subprocess\n\nresult = subprocess.run(\n    [\"ollama\", \"run\", \"gemma3\", \"Explain what a reverse proxy does in two sentences.\"],\n    capture_output=True,\n    text=True,\n)\nprint(result.stdout)<\/pre><p>The library is the cleaner choice for real applications because it returns structured data and supports streaming. The <strong>subprocess<\/strong> approach only runs the same command you&rsquo;d type by hand.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-automate-ollama-cli-workflows\"><strong>How to automate Ollama CLI workflows<\/strong><\/h2><p>Automating Ollama CLI workflows means running repeatable prompts, saving their output, and scheduling local model tasks from shell scripts.<\/p><p>Common use cases include generating a daily summary from a log file or classifying new files dropped into a folder.<\/p><p>Bash scripts handle the repeatable command, and cron handles the schedule. You can also connect <a href=\"\/in\/tutorials\/n8n-ollama-integration\/\">Ollama to an automation platform like n8n<\/a>.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to create a Bash script for Ollama<\/strong><\/h3><p>Create a Bash script for Ollama by saving your commands in a <strong>.sh<\/strong> file. <a href=\"\/in\/tutorials\/bash-scripting-tutorial\/\">Bash scripting<\/a> turns a repeated terminal command into a single file you can run on demand.<\/p><p>Create the script file with a text editor:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>nano ollama-summary.sh<\/pre><p>Add the shebang line, a comment, and the command:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>#!\/bin\/bash\n# Summarize today's error log and save the result with the date in the filename\nollama run gemma3 \"Summarize the main errors in this log in five bullet points:\" &lt; \/var\/log\/app\/error.log &gt; \"summary-$(date +%F).txt\"<\/pre><p>Save and close the file.<\/p><p>Make the script executable, then run it:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>chmod +x ollama-summary.sh\n.\/ollama-summary.sh<\/pre><p>The comment explains the command, and <strong>$(date +%F)<\/strong> adds the current date to the filename. More <a href=\"\/in\/tutorials\/bash-script-example\/\">Bash script examples<\/a> show patterns you can adapt for log parsing, file classification, and scheduled reports.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to schedule Ollama commands with cron<\/strong><\/h3><p>Schedule Ollama commands with a <a href=\"\/in\/tutorials\/cron-job\/\">cron job<\/a> by adding your script to the crontab. Open the editor with the command below, and choose <strong>nano<\/strong> if it asks which editor to use:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>crontab -e<\/pre><p>A cron line has five time fields followed by the command: minute, hour, day of the month, month, and day of the week. The example below runs the summary script at <strong>7 AM<\/strong> every Monday:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>0 7 * * 1 \/home\/user\/ollama-summary.sh<\/pre><p>Add that line to the bottom of the file, then save and close the editor.<\/p><figure data-wp-context='{\"imageId\":\"6a52321671f74\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a52321671f74\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-cron-schedule-scaled.png\/w=1024,h=1024,fit=scale-down\" alt='\"GNU' nano editing the crontab with a am monday line to run ollama-summary.sh class='\"wp-image-151683\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>This works well for recurring jobs, such as a weekly report or daily local digest.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-how-to-use-the-ollama-cli-with-integrations-and-cloud-models\"><strong>How to use the Ollama CLI with integrations and cloud models<\/strong><\/h2><p>The Ollama CLI connects to external tools with <strong>ollama launch<\/strong> and to your account with <strong>ollama signin<\/strong>. Both workflows are optional and useful when you want to use Ollama inside a coding tool or need models that are too large for your hardware.<\/p><p>These commands build on the core CLI, so use them once the basics feel familiar.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to launch coding tools with Ollama<\/strong><\/h3><p>Launch coding tools with <strong>ollama launch<\/strong>, which configures and opens a supported app with a local model. Running it with no arguments opens an interactive menu of tools:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama launch<\/pre><p>Name a tool to launch it directly:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama launch claude<\/pre><p>If you haven&rsquo;t, install it first:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>curl -fsSL https:\/\/claude.ai\/install.sh | bash<\/pre><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>echo 'export PATH=\"$HOME\/.local\/bin:$PATH\"' &amp;gt;&amp;gt; ~\/.bashrc &amp;amp;&amp;amp; source ~\/.bashrc<\/pre><p>Add <strong>&ndash;model<\/strong> to choose which local model the tool uses:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama launch claude --model gemma3<\/pre><figure data-wp-context='{\"imageId\":\"6a52321673fa9\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a52321673fa9\" class='\"wp-block-image wp-lightbox-container' aligncenter size-large><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/10\/ollama-cli-launch-claude-code-scaled.png\/w=1024,h=1024,fit=scale-down\" alt='\"Claude' code launched via ollama launch showing its theme selection screen class='\"wp-image-151685\"'><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>Supported tools include Claude Code, Codex, Copilot CLI, OpenClaw, and Droid. The command handles the setup, so you don&rsquo;t need to configure each tool by hand.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>How to sign in and run Ollama cloud models<\/strong><\/h3><p>Sign in to your account with <strong>ollama signin<\/strong>, and end the session with <strong>ollama signout<\/strong>. Signing in links your <strong>ollama.com<\/strong> account, which cloud models need:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama signin<\/pre><p>To sign out:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama signout<\/pre><p>Cloud models run on Ollama&rsquo;s hosted hardware while you keep using the same commands locally. They&rsquo;re useful when a model is too large to run on your own machine. For other tasks, the fully local workflow stays the default.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-common-ollama-cli-issues-and-fixes\"><strong>Common Ollama CLI issues and fixes<\/strong><\/h2><p>Most Ollama CLI problems come from installation issues, hardware limits, or the server not running. The fixes below resolve the three issues you&rsquo;re most likely to hit.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>Ollama command not found<\/strong><\/h3><p>The <strong>&ldquo;command not found&rdquo;<\/strong> error usually means Ollama isn&rsquo;t installed correctly, or the terminal can&rsquo;t find the executable. Close and reopen the terminal so it picks up the updated path, since the installer adds <strong>ollama<\/strong> to the path during setup.<\/p><p>If the error continues, try reinstalling Ollama again. A fresh install can repair a broken or incomplete setup.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>Ollama model runs slowly<\/strong><\/h3><p>A slow model usually means the model is too large for your available RAM, CPU, or GPU. If the model doesn&rsquo;t fit your hardware, it may fall back to the CPU, which is much slower than a GPU.<\/p><p>Try a smaller model before changing any system settings. Switching from a large model to <strong>gemma3:1b<\/strong>, which is about <strong>815 MB<\/strong>, often restores usable speed on modest hardware.<\/p><h3 class='\"wp-block-heading\" wp-block-heading'><strong>Ollama server is not responding<\/strong><\/h3><p>An unresponsive server usually means the Ollama service isn&rsquo;t running. On Linux, check the service status with <strong>systemctl status ollama<\/strong>. If it&rsquo;s stopped, start it with <strong>sudo systemctl start ollama<\/strong>.<\/p><p>If you&rsquo;re running Ollama manually instead of as a service, start it with:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama serve<\/pre><p>Once the server is running, verify it&rsquo;s working with:<\/p><pre class='\"EnlighterJSRAW\"' data-enlighter-language='\"generic\"' data-enlighter-theme='\"\"' data-enlighter-highlight='\"\"' data-enlighter-linenumbers='\"\"' data-enlighter-lineoffset='\"\"' data-enlighter-title='\"\"' data-enlighter-group='\"\"'>ollama ps<\/pre><p>This command lists the models currently loaded in memory. If <strong>ollama ps<\/strong> returns model information, the server is running.<\/p><p>If the server still won&rsquo;t start, another process or background service may already be using port <strong>11434<\/strong>. Stop the conflicting process or service to free the port.<\/p><h2 class='\"wp-block-heading\" wp-block-heading' id=\"h-next-steps-after-learning-ollama-cli\"><strong>Next steps after learning Ollama CLI<\/strong><\/h2><p>The next step after learning the Ollama CLI is to use these commands in real projects, from scripted prompts and scheduled jobs to a local API your own apps can call.<\/p><p>The terminal is the fastest way to pull models, automate tasks, and connect Ollama to your code. That makes it a natural fit for developers and server workflows.<\/p><p>A graphical interface suits the opposite preference: working in a visual dashboard instead of typing commands.<\/p><p>Our <a href=\"\/in\/tutorials\/ollama-gui-tutorial\/\">Ollama GUI tutorial<\/a> walks through a browser-based setup that handles tasks the terminal doesn&rsquo;t, including running several models at once, comparing answers side by side, keeping a searchable chat history, uploading documents for the model to reference, and turning on web search.<\/p><p>That said, the CLI stays the better tool for scripting and servers, while the GUI works better for visual, shared, day-to-day use.<\/p><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The Ollama CLI is the command-line interface for downloading, running, managing, customizing, and connecting local AI models from your terminal. With the CLI, you can chat with models, send single prompts, customize model behavior with a Modelfile, expose a local API, automate tasks with scripts, and connect Ollama to coding tools and cloud models. Using [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/ollama-cli-tutorial\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":411,"featured_media":134522,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Ollama CLI tutorial: Learn how to use Ollama in the terminal","rank_math_description":"Learn how to use Ollama in the command-line interface (CLI). Set up models, customize parameters, and automate tasks from the terminal.","rank_math_focus_keyword":"ollama cli tutorial","footnotes":""},"categories":[22640],"tags":[],"class_list":["post-118185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/tutoriel-ollama-cli","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/tutorial-de-ollama-cli\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/panduan-ollama-cli","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/tutorial-de-ollama-cli\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/tutorial-de-ollama-cli\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/tutorial-de-ollama-cli\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/ollama-cli-tutorial\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/ollama-cli-tutorial\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/118185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=118185"}],"version-history":[{"count":13,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/118185\/revisions"}],"predecessor-version":[{"id":134521,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/118185\/revisions\/134521"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media\/134522"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=118185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=118185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=118185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}