Component brief / Models
Hugging Face: find AI models and try them in your application.
What it is
The Hugging Face Hub is a website where people and organisations publish AI projects. You will mainly encounter three things:
- Models: files that a program loads to perform a task, such as generating text or recognising speech.
- Datasets: collections of text, images, audio or other examples used to train and test models.
- Spaces: applications you can try in your browser, often built to demonstrate a model.
A model page usually includes a model card: the author's description of what the model does, how to use it and its limitations. Check its licence too; being available to download does not mean every use is allowed.
Hugging Face also makes programming libraries. Transformers helps developers load, run and train supported models. Datasets helps them load and prepare example data.
Where it fits
Think of two separate decisions: which model will you use, and where will it run? Finding a model on Hugging Face answers the first question.
For the second, you can download the files and run a compatible model on your own computer or server. Alternatively, your application can send requests to a hosted service, where another company runs the model. Hugging Face offers access to inference providers and dedicated endpoints—services that run a model for your application.
Here, inference simply means running a trained model to produce a result.
When to use it
Hugging Face is useful when you want to:
- find and compare models for a particular task;
- download a model to run on your own hardware;
- find example data for training or testing;
- share a model, dataset or working demo with other people.
For example, you could look for a model that sorts customer messages into categories such as billing, technical support and cancellations. Try it on messages with known categories before connecting it to your support system.
Trade-offs
The quality of published projects varies. Some have clear instructions and useful test results; others provide little explanation. Read the model card and test the model on examples from your own work.
Running a model yourself requires suitable software, enough memory and sometimes a powerful graphics card. Calling a hosted model avoids managing that hardware, but adds service costs and sends your input to the provider. Check where that data goes before using customer messages.
Keep a record of the exact model version you tested. Otherwise, a later download may give you different files and different results. If a model asks you to enable trust_remote_code=True, you are allowing downloaded code to run; review that code before enabling it.
Alternatives
The right alternative depends on what you need:
- A hosted AI API: a direct provider API may be simpler if you already know which model you want.
- Ollama: useful for downloading and running supported models locally; see the Ollama brief.
- An internal model store: useful when your organisation needs to approve files before developers can use them.
These options can overlap. A model found on Hugging Face may also be available through a local tool or a hosted provider.
Integration example
Suppose you are adding a Suggest category button to a support application:
- Find a model whose documentation describes text classification: assigning text to categories.
- Check its licence and test it with sample messages and your intended categories.
- Choose whether to run it on your own server or call a hosted version.
- Have your application send the message to the model and display the suggested category for review.
Hugging Face helps you find and obtain the model. Your application still supplies the button, sends the input and decides how to use the result. Test that complete flow before relying on the suggestions.
AI Disclosure
Researched and drafted with AI assistance, then reviewed by Søren Dalby. Sources are linked; errors may remain, and corrections are welcome.