Hugging Face is well known for its great work on the Python Transformers library, and for its big machine learning models repository. But they also provide an inference API and a fine-tuning platform called AutoTrain.

NLP Cloud’s API and NLP Cloud’s fine-tuning platform are direct competitors of Hugging Face’s API and AutoTrain. Let’s compare the pricing and features of these 2 actors here!

Pricing: Hugging Face VS NLP Cloud

First, it’s worth noting that the NLP Cloud API can be tested for free when used on a CPU and a GPU (thanks to the free plan and the pay-as-you-go plan that offers 100k free tokens), while the Hugging Face API can only be tested for free on a CPU (thanks to their free plan). It is an important difference since the most interesting Transformer-based AI models run much faster on a GPU. Some even just don’t run on a GPU.

Hugging Face Pricing

Hugging Face Pricing

In terms of plans, Hugging Face only proposes pay-as-you-go pricing (pricing based on your consumption) while NLP Cloud both proposes pre-paid plans and pay-as-you-go plans. Let’s say you want to perform text classification on pieces of text that contain around 5k words on average, at a rate of 15 requests per minute, on a GPU. Hugging Face’s pricing is based on the number of characters, while NLP Cloud’s one is based on the number of tokens. 5k words are more or less equivalent to 15k characters and to 3,750 tokens. On NLP Cloud it will cost you $99/month by subscribing to the Starter GPU Plan, while on Hugging Face it will cost you 15k x 15 x 60 x 24 x 31 x $50 / 1M = $500k/month (!!!).

As you can see, it seems that the Hugging Face pay-as-you-go pricing is absolutely not suited for a production use. Literally no-one is going to pay such a price for text classification on a GPU…

As far as fine-tuning is concerned, it is not even possible to compare as Hugging Face’s AutoTrain pricing is not public. I registered and tried their AutoTrain solution, but I was still unable to find any clear pricing…

Models Available

The great thing with Hugging Face is that they host tons of AI models on their platform! However it does not mean that you can actually use these models. You can of course download them, but this is not the same as using them.

Only a very small fraction of Hugging Face’s models are actually available for inference through their API. If you try to use a model that is not already loaded, you will either have to wait for several minutes, or simply get an error. A solution is to pin the models you want to use so they are always available, but in that case you have to pay an additional $5/month per model on a GPU.

NLP Cloud chose a different strategy: around 50 different AI models are available all the time. A model is selected when it is considered the best model for a specific use case. For example, Bart Large MNLI is used for classification, Distilbert for sentiment analysis, and GPT-J for intent detection.

More importantly: the most advanced AI models like GPT-J are not available on the Hugging Face API, and cannot be fine-tuned on their AutoTrain platform, while you can easily use and fine-tune these large language models on NLP Cloud.

GPT-J API example on NLP Cloud

GPT-J API example on NLP Cloud

Support

Hugging Face only offers support if you select their Lab or Enterprise plan.

NLP Cloud offers support to any customer, whether a free customer, a small paid customer, or an Enterprise one. Good support is critical when it comes to AI and natural language processing because customers can have tons of interesting technical or business questions.

Speed And Reliability

In my benchmarks, I noticed a lower latency on the NLP Cloud API for all the models I tested, whether on a CPU or a GPU.

Speed is critical for such a machine learning API, and the fact that NLP Cloud responds faster can make a big difference, depending on your business requirements.

As far as fine-tuning is concerned, I was unable to make a proper comparison for the moment because most of the fine-tunings I launched on the Hugging Face AutoTrain platform failed without explicit error message.

Where Should Tech Families Relocate? Salary Versus Family Cost of Living

I ranked 64 tech hubs on what a senior software engineer with a partner at home and two young children keeps each month after tax, rent, living costs, school, healthcare and a car. United States cities still lead, Zurich breaks even, and many Asian and African hubs turn negative once international school and private health enter the picture. Continue reading