{"slug": "fine-tune-deploy-and-use-llm-as-ai-agent", "title": "Fine-Tune, Deploy and Use LLM As AI Agent", "summary": "A developer published a video walkthrough demonstrating an end-to-end pipeline for fine-tuning a large language model and deploying it as an AI agent, using Runpod for GPU rental and serverless inference, Unsloth Studio for training, and Pydantic AI to build an agent that calls the fine-tuned model through an OpenAI-compatible endpoint. The walkthrough covers Pod setup, GPU selection, storage configuration, and SSH access, and warns that failing to set UNSLOTH_STUDIO_HOME to /workspace causes Unsloth Studio to write to the container disk instead of the persistent volume, losing training data when the pod is stopped. The developer also notes that fine-tuning is best suited to changing model behavior such as tone or style, and that pairing a fine-tuned model with retrieval-augmented generation remains the safer route for accuracy and up-to-date information.", "body_md": "In this video I continue the fine-tuning series on my [channel](https://www.youtube.com/@joxiahdev). This time I go through the whole pipeline, not just the training part: renting GPUs on [Runpod](https://runpod.io?ref=3cfpyagl), fine-tuning a model with [Unsloth Studio](https://unsloth.ai/docs/new/studio/install), deploying it as an inference endpoint using Runpod's Serverless, and then actually using that endpoint inside a [Pydantic AI](https://pydantic.dev/docs/ai/overview/) Agent.\n\nThis is meant to cover the full path: rent the GPU, train the model, deploy it, and get it hooked up to something that can actually call it.\n\nI go in-depth on creating a Pod (a dedicated GPU instance container), picking a GPU, setting up storage, and getting SSH access working. The whole setup also works through the accompanying Jupyter Notebook, but I show the terminal option too.\n\nOne thing I didn't call out clearly enough in the video: run `apt update && apt upgrade -y` right after you SSH in, before installing anything else. A fresh Pod's package index is often out of date, so skipping this can mean installs failing or pulling older versions of tools than you'd expect.\n\nBefore you get into training, it's worth understanding how storage works on a Pod, because it's easy to get caught out. You've got 3 options:\n\nVolume disk is usually what's mounted on your `/workspace` directory.\n\nIf you install Unsloth Studio without setting `UNSLOTH_STUDIO_HOME` first, like this:\n\n```\nexport UNSLOTH_STUDIO_HOME=/workspace\n```\n\nUnsloth Studio will quietly ignore `/workspace` and fall back to `/root/.unsloth/studio` instead, which is outside the volume disk and sitting on the container disk. You won't notice anything's wrong until you stop the pod to save some money, come back the next day, and your training setup is gone. Ask me how I know!\n\nI didn't go in-depth on optimizing Runpod usage in the video itself, but a couple of things are worth knowing:\n\nOnce the model was trained and deployed, the last piece was actually using it. I set up a Pydantic AI [agent](https://colab.research.google.com/drive/1ZXlspobgVa_lRUcDKlizOnuPg_fp7hg_?usp=sharing) that calls the fine-tuned model through the endpoint. I went with Pydantic AI's OpenAI provider for this, since vLLM (the inference framework running behind the endpoint) supports the OpenAI response format.\n\nFine-tuning is best when you're trying to modify the behavior of a model, like response style, tone etc. You can also teach it new knowledge, but even after fine-tuning, models can still hallucinate or fall back on old data. For anything that needs to stay accurate and up to date, pairing your fine-tuned model with Retrieval Augmented Generation (RAG) is still the safer route, since RAG pulls in fresh, sourced info at request time instead of relying on whatever got baked in during training.\n\nIf you enjoyed this, feel free to subscribe to the [channel](https://www.youtube.com/@joxiahdev).\n\nThanks and happy coding!", "url": "https://wpnews.pro/news/fine-tune-deploy-and-use-llm-as-ai-agent", "canonical_source": "https://dev.to/joxiahdev/fine-tune-deploy-and-use-llm-as-ai-agent-42cn", "published_at": "2026-09-22 08:10:00+00:00", "updated_at": "2026-09-22 08:22:38.353093+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "ai-tools", "mlops", "ai-infrastructure"], "entities": ["Runpod", "Unsloth Studio", "Pydantic AI", "vLLM", "Joxiah Dev"], "alternates": {"html": "https://wpnews.pro/news/fine-tune-deploy-and-use-llm-as-ai-agent", "markdown": "https://wpnews.pro/news/fine-tune-deploy-and-use-llm-as-ai-agent.md", "text": "https://wpnews.pro/news/fine-tune-deploy-and-use-llm-as-ai-agent.txt", "jsonld": "https://wpnews.pro/news/fine-tune-deploy-and-use-llm-as-ai-agent.jsonld"}}