{"course":{"slug":"hugging-face","title":"Hugging Face, End to End","url":"https://addaly.com/learn/hugging-face","level":"intermediate","track":"create"},"lesson":{"slug":"four-shelves","title":"Four shelves, and picking the wrong one costs a weekend","url":"https://addaly.com/learn/hugging-face/four-shelves","position":7,"of":75,"minutes":8,"answer":"Models are parts, datasets are material, Spaces are finished tools and inference is rented hardware: choose the shelf by how often the job runs and whether the data may leave your machine.","keyIdea":"Models are parts, datasets are material, Spaces are finished tools and inference is rented hardware: choose the shelf by how often the job runs and whether the data may leave your machine."},"body":{"format":"markdown","text":"## The question that decides everything\n\nThe Hub holds four kinds of thing, and beginners lose days by reaching for the wrong one. A creative person who wants forty photographs cut out downloads a 7 GB model and installs Python for two days. A developer who needs a background job run nightly opens a browser app and clicks four hundred times. Both are working hard in the wrong place.\n\n## The four shelves\n\n**Models** are weights plus configuration. A model is inert. It does nothing until some code loads it, so a model page is a parts bin, not a tool.\n\n**Datasets** are the data (text, images, audio, labels) with an automatic preview table and, for public datasets, an automatic conversion to a queryable format. Lesson eight is about using them without downloading them.\n\n**Spaces** are running applications. Someone has written the code, listed the dependencies and pointed it at a model, and the Hub runs it on a URL. This is the shelf that matters most if you do not write code, and lessons four and five are about it.\n\n**Inference** is somebody else's hardware running a model for you over an API. Two shapes:\n\n- **Inference Providers** route your request out to partner companies: the roster has included Together, Fireworks, Replicate, Groq, Cerebras, SambaNova and others, and it changes. One API key reaches many models, and you pay per token or per image. Free accounts get a small monthly credit; a PRO subscription, around nine dollars a month as of late 2025, raises it. Check current prices rather than trusting that figure.\n- **Inference Endpoints** are a dedicated container on a GPU you rent by the hour. Right when you need consistent latency or isolation, wrong for occasional use, because it bills while idle unless you configure it to scale to zero.\n\n## Choosing, in one pass\n\n- You want a job done a handful of times, on your own files, today → **a Space**.\n- You want the same job done four hundred times, on a schedule → **a provider API**, or a script running the model locally.\n- The material must not leave your machine: client photographs, medical notes, a customer's confidential documents → **local**, and nothing else. This is not a preference. Uploading is a disclosure.\n- You want to show a colleague, or change how the tool behaves → **duplicate a Space**.\n- You want to train or fine-tune → **a dataset plus a GPU**, which does not have to be a paid one. Kaggle notebooks give roughly thirty GPU-hours a week free once you verify a phone number, and Google Colab's free tier gives a smaller, interruptible allocation. Both are real options if a rented GPU is out of reach.\n\n## The part nobody mentions about public Spaces\n\nA public Space is arbitrary code, written by a stranger, running on a machine you do not control, and whatever you upload passes through it. Most authors are decent and most Spaces are thin wrappers around a model. But the honest position is that you cannot know, and the thing that makes the Hub unusual is that you can go and look: the Files tab of a Space shows `app.py`. Read it. It is normally under two hundred lines.\n\nFor anything sensitive, duplicate the Space into your own account so the code runs under your control, or run the model locally. The next two lessons cover the first; lesson seven covers the second.\n\n## Do this now\n\nTake the task actually in front of you and say out loud which of the four shelves it belongs on, and why the other three are wrong. If the answer is *local because the files are confidential*, skip ahead to lesson seven before you upload anything."},"check":{"question":"A freelance retoucher has sixty client photographs under a confidentiality agreement, a laptop with no GPU, and no Python installed. She needs the backgrounds removed. What is the right route?","options":[{"text":"Use a popular public background-removal Space, since sixty images is well within the free CPU tier and needs no installation.","correct":false,"tempting":"Weighs convenience and hardware limits while ignoring that uploading confidential files is itself a disclosure."},{"text":"Call an Inference Provider API, because per-image billing is cheaper than renting hardware for a batch this small.","correct":false,"tempting":"Solves for cost and still sends the confidential images to a third party."},{"text":"Rent an Inference Endpoint on a GPU for an hour, since a dedicated container keeps the work isolated and fast.","correct":false,"tempting":"Treats a dedicated rented container as equivalent to the files never leaving her machine."},{"text":"Run a background-removal model locally on the CPU, because the confidentiality agreement rules out uploading and this task runs acceptably without a GPU.","correct":true}]},"prev":{"slug":"safetensors-and-pickle","title":"Loading a model can run someone else's code","url":"https://addaly.com/learn/hugging-face/safetensors-and-pickle"},"next":{"slug":"the-hub-api","title":"Ask the Hub questions instead of browsing it","url":"https://addaly.com/learn/hugging-face/the-hub-api"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Four shelves, and picking the wrong one costs a weekend', in Hugging Face, End to End. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/hugging-face/four-shelves (Accessed: 31 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Four shelves, and picking the wrong one costs a weekend","courseTitle":"Hugging Face, End to End","module":{"index":1,"slug":"the-hub-as-a-repository-host","title":"The Hub, read properly"},"answer":null,"keyIdea":"Models are parts, datasets are material, Spaces are finished tools and inference is rented hardware: choose the shelf by how often the job runs and whether the data may leave your machine.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-question-that-decides-everything","runs":[{"text":"The question that decides everything"}]},{"t":"p","runs":[{"text":"The Hub holds four kinds of thing, and beginners lose days by reaching for the wrong one. A creative person who wants forty photographs cut out downloads a 7 GB model and installs Python for two days. A developer who needs a background job run nightly opens a browser app and clicks four hundred times. Both are working hard in the wrong place."}]},{"t":"h2","id":"the-four-shelves","runs":[{"text":"The four shelves"}]},{"t":"p","runs":[{"text":"Models","b":true},{"text":" are weights plus configuration. A model is inert. It does nothing until some code loads it, so a model page is a parts bin, not a tool."}]},{"t":"p","runs":[{"text":"Datasets","b":true},{"text":" are the data (text, images, audio, labels) with an automatic preview table and, for public datasets, an automatic conversion to a queryable format. Lesson eight is about using them without downloading them."}]},{"t":"p","runs":[{"text":"Spaces","b":true},{"text":" are running applications. Someone has written the code, listed the dependencies and pointed it at a model, and the Hub runs it on a URL. This is the shelf that matters most if you do not write code, and lessons four and five are about it."}]},{"t":"p","runs":[{"text":"Inference","b":true},{"text":" is somebody else’s hardware running a model for you over an API. Two shapes:"}]},{"t":"ul","items":[[{"text":"Inference Providers","b":true},{"text":" route your request out to partner companies: the roster has included Together, Fireworks, Replicate, Groq, Cerebras, SambaNova and others, and it changes. One API key reaches many models, and you pay per token or per image. Free accounts get a small monthly credit; a PRO subscription, around nine dollars a month as of late 2025, raises it. Check current prices rather than trusting that figure."}],[{"text":"Inference Endpoints","b":true},{"text":" are a dedicated container on a GPU you rent by the hour. Right when you need consistent latency or isolation, wrong for occasional use, because it bills while idle unless you configure it to scale to zero."}]]},{"t":"h2","id":"choosing-in-one-pass","runs":[{"text":"Choosing, in one pass"}]},{"t":"ul","items":[[{"text":"You want a job done a handful of times, on your own files, today → "},{"text":"a Space","b":true},{"text":"."}],[{"text":"You want the same job done four hundred times, on a schedule → "},{"text":"a provider API","b":true},{"text":", or a script running the model locally."}],[{"text":"The material must not leave your machine: client photographs, medical notes, a customer’s confidential documents → "},{"text":"local","b":true},{"text":", and nothing else. This is not a preference. Uploading is a disclosure."}],[{"text":"You want to show a colleague, or change how the tool behaves → "},{"text":"duplicate a Space","b":true},{"text":"."}],[{"text":"You want to train or fine-tune → "},{"text":"a dataset plus a GPU","b":true},{"text":", which does not have to be a paid one. Kaggle notebooks give roughly thirty GPU-hours a week free once you verify a phone number, and Google Colab’s free tier gives a smaller, interruptible allocation. Both are real options if a rented GPU is out of reach."}]]},{"t":"h2","id":"the-part-nobody-mentions-about-public-spaces","runs":[{"text":"The part nobody mentions about public Spaces"}]},{"t":"p","runs":[{"text":"A public Space is arbitrary code, written by a stranger, running on a machine you do not control, and whatever you upload passes through it. Most authors are decent and most Spaces are thin wrappers around a model. But the honest position is that you cannot know, and the thing that makes the Hub unusual is that you can go and look: the Files tab of a Space shows "},{"text":"app.py","code":true},{"text":". Read it. It is normally under two hundred lines."}]},{"t":"p","runs":[{"text":"For anything sensitive, duplicate the Space into your own account so the code runs under your control, or run the model locally. The next two lessons cover the first; lesson seven covers the second."}]},{"t":"h2","id":"do-this-now","runs":[{"text":"Do this now"}],"role":"try"},{"t":"p","runs":[{"text":"Take the task actually in front of you and say out loud which of the four shelves it belongs on, and why the other three are wrong. If the answer is "},{"text":"local because the files are confidential","i":true},{"text":", skip ahead to lesson seven before you upload anything."}]}],"check":{"question":[{"text":"A freelance retoucher has sixty client photographs under a confidentiality agreement, a laptop with no GPU, and no Python installed. She needs the backgrounds removed. What is the right route?"}],"options":[{"text":[{"text":"Use a popular public background-removal Space, since sixty images is well within the free CPU tier and needs no installation."}],"correct":false,"tempting":[{"text":"Weighs convenience and hardware limits while ignoring that uploading confidential files is itself a disclosure."}]},{"text":[{"text":"Call an Inference Provider API, because per-image billing is cheaper than renting hardware for a batch this small."}],"correct":false,"tempting":[{"text":"Solves for cost and still sends the confidential images to a third party."}]},{"text":[{"text":"Rent an Inference Endpoint on a GPU for an hour, since a dedicated container keeps the work isolated and fast."}],"correct":false,"tempting":[{"text":"Treats a dedicated rented container as equivalent to the files never leaving her machine."}]},{"text":[{"text":"Run a background-removal model locally on the CPU, because the confidentiality agreement rules out uploading and this task runs acceptably without a GPU."}],"correct":true,"tempting":null}],"order":[2,0,1,3],"why":null},"prev":{"slug":"safetensors-and-pickle","title":"Loading a model can run someone else’s code","minutes":9},"next":{"slug":"the-hub-api","title":"Ask the Hub questions instead of browsing it","minutes":9}}}