Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of Free Local LLM Models - Up and Running #967

Closed
psymbio opened this issue Mar 13, 2025 · 5 comments · May be fixed by huggingface/agents-course#327
Closed

List of Free Local LLM Models - Up and Running #967

psymbio opened this issue Mar 13, 2025 · 5 comments · May be fixed by huggingface/agents-course#327
Labels
enhancement New feature or request

Comments

@psymbio
Copy link

psymbio commented Mar 13, 2025

Is your feature request related to a problem? Please describe.
Can I get a list of free local LLM models I can run without the PRO subscription.

Describe the solution you'd like
A list of the args I can pass into HfApiModel() (most likely) so that I don't run into this error:

You have exceeded your monthly included credits for Inference Providers. Subscribe to PRO to get 20x more monthly
included credits.
[Step 17: Duration 0.30 seconds| Input tokens: 53,107 | Output tokens: 4,313]

Is this not possible with the current options.
I've tried DeepSeek model, which I thought would be free - but turns out even that is connected to the Together API. How can I get a local free LLM model up and running with smolagents?

Maybe this code sample can be provided in the README section.

@psymbio psymbio added the enhancement New feature or request label Mar 13, 2025
@HKanoje
Copy link

HKanoje commented Mar 14, 2025

@psymbio I faced the same problem when i was doing the hugging face AI agents course . So I figured out out this way:
You can use ollama + LiteLLM instead of HfApiModel() to Run model locally and and for free without any limits. Below Code is how you can load the model run. Check out models on ollama website. there are plenty of options. All for Free.

from smolagents import CodeAgent, LiteLLMModel

model = LiteLLMModel(
    model_id="ollama_chat/qwen2.5:7b", #Can try diffrent model here I am using qwen2.5 7B model
    api_base="http://127.0.0.1:11434",
    num_ctx=8192,
)

agent = CodeAgent(tools=[], model=model, add_base_tools=True)

agent.run("Could you give me the 118th number in the Fibonacci sequence?")

@aymeric-roucher
Copy link
Collaborator

The solution described by @HKanoje is good! If you think it's worth it, please open a PR ion the docs wherever you faced the problem (in agents course?) to add this as a note like "if you run into credit limits, you can switch to local inference using ...".

@HKanoje
Copy link

HKanoje commented Mar 15, 2025

@aymeric-roucher Okay got it. Will do ASAP. Just a quick question should i make note everywhere HfApiModel() is used or just initial agent will do?

@HKanoje
Copy link

HKanoje commented Mar 16, 2025

Hey @aymeric-roucher , just letting you know that I’ve opened a PR huggingface/agents-course#327 with the note on using Ollama + LiteLLM as a local alternative to HfApiModel.

@albertvillanova
Copy link
Member

Thanks, @HKanoje, for the PR in agents-course.
Closing the issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants