Skip to content

Add note on local inference alternative to HfApiModel#327

Merged
burtenshaw merged 1 commit into
huggingface:mainfrom
HKanoje:add-local-inference-note
Mar 24, 2025
Merged

Add note on local inference alternative to HfApiModel#327
burtenshaw merged 1 commit into
huggingface:mainfrom
HKanoje:add-local-inference-note

Conversation

@HKanoje

@HKanoje HKanoje commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

This PR adds a note in the docs explaining how users can run models locally using Ollama + LiteLLM as an alternative to HfApiModel() in case they hit Hugging Face API credit limits.

It includes a sample code snippet using:

LiteLLMModel with model_id="ollama_chat/qwen2.5:7b"

It closes huggingface/smolagents#967 Issues

@davidberenstein1957

Copy link
Copy Markdown
Contributor

Hi @HKanoje, this could be a nice addition if we could scope this a bit more uniform.

Could you create a uniform section on this within the onboarding? I think we can just mention local serving and ideally use similar API classed (the HF ones) but explain how to redirect the base URL that relies on OpenAIAPI spec for something like ollama.

WDYT?

@HKanoje

HKanoje commented Mar 17, 2025

Copy link
Copy Markdown
Contributor Author

@davidberenstein1957 Yes I think you're right. It makes more sense to put in as a different section because HfApiModel() is been used everywhere what do you suggest where should I make this section? During the onboarding steps?

@HKanoje HKanoje force-pushed the add-local-inference-note branch from ae82b7b to 2139435 Compare March 19, 2025 19:28
@HKanoje

HKanoje commented Mar 19, 2025

Copy link
Copy Markdown
Contributor Author

Hey, @davidberenstein1957 I’ve added the local inference section to the onboarding as you suggested. Let me know if there’s anything you'd like me to adjust or improve! Check here #327

@burtenshaw burtenshaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a really nice addition to the course. Do you have a twitter or linkedin profile? I'd like to communicate about it.

@burtenshaw burtenshaw merged commit 6d5ca4a into huggingface:main Mar 24, 2025
@HKanoje

HKanoje commented Mar 24, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the approval and kind words, @burtenshaw I’m glad you like the addition. This is my twitter: https://x.com/hrithik_kanoje0 and this is my LinkedIn: https://www.linkedin.com/in/hrithikkanoje/ Feel free to connect, and I’d be happy to discuss further!

@HKanoje HKanoje deleted the add-local-inference-note branch March 27, 2025 13:21
giacomosansoni pushed a commit to giacomosansoni/agents-course that referenced this pull request May 17, 2025
Add note on local inference alternative to HfApiModel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List of Free Local LLM Models - Up and Running

3 participants