# Avoiding the usage of HfApiModel and using local model - \`smolagents\`

**URL:** <https://discuss.huggingface.co/t/avoiding-the-usage-of-hfapimodel-and-using-local-model-smolagents/152711>\
**Category:** Beginners\
**Created:** [April 28, 2025, 7:30pm UTC](https://discuss.huggingface.co/t/avoiding-the-usage-of-hfapimodel-and-using-local-model-smolagents/152711 "2025-04-28T19:30:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 29, 2025, 12:30am UTC](https://discuss.huggingface.co/t/avoiding-the-usage-of-hfapimodel-and-using-local-model-smolagents/152711/2 "2025-04-29T00:30:17Z")

</div>

There are several methods, but you can use `TransformersModel` instead of `HfApiModel` and it will work. When using large models, powerful GPUs are required, so please be careful. Well, I think `SmolLM` below will work with about 1GB of VRAM…

Also, `Ollama` is faster and uses less VRAM, but I think it will be a little difficult to set up (compared to `TransformersModel`…).

```py
from smolagents import TransformersModel

model = TransformersModel(model_id="HuggingFaceTB/SmolLM-135M-Instruct")

```

> **[Models](https://huggingface.co/docs/smolagents/en/reference/models#smolagents.TransformersModel)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> [@How to deploy smolagents locally](https://discuss.huggingface.co/t/how-to-deploy-smolagents-locally/152353):
>
> Hello, is there an article that describes the steps to how to deploy smolagents locally. thanks

---

_[View the full topic](https://discuss.huggingface.co/t/avoiding-the-usage-of-hfapimodel-and-using-local-model-smolagents/152711)._
