4 min read
Deployment
Turn a trained model into a web page that runs in the visitor's browser, check it, and download or publish it from your own account.
What it does
Deployment turns a model you trained into something other people can use: a web page, with a form built from what the model takes, that runs the model on the visitor's own device. Press Deploy beside a model and a working page appears in a preview on the right, with nothing to set up first. Then change what you like, check it, and download it or publish it.
From a model to a page
Open Deployment and choose a model from the project. Each one says what it is (for example "Table → no / yes", "Picture → 3 classes", "2 outputs") and whether it is ready. DLWAY reads the model and the table it was trained on: the column names, their ranges and categories, the class labels. A model with one sigmoid output is shown as two labels, not as "class 0".
Anything it could not find out is listed under Inputs and outputs with one control to answer it, instead of being guessed. A blank required field is never read as 0: the page asks for a value.
The five sections
- Inputs and outputs: what the model takes and gives, in a person's terms. Rename the classes, set a field's range, say which output is which.
- App: the page itself. Title, tagline, colours, which blocks appear (examples, a batch tab that scores a CSV, the model's details), the words on the page, and whether the page keeps itself in the browser to work offline. The preview redraws as you type and the model is not loaded again.
- Targets: what to build. A web app (a folder of files), a single HTML file, a widget for another page (
<dlway-model src="…">and a self-sizing iframe), a JavaScript module with a typedpredict(), the model files with a model card, or a Python app (on ONNX Runtime, with no TensorFlow, where the model can be exported, and on Keras otherwise): a Streamlit app, a Gradio app, a REST API or a notebook. A card at the top says what runs the model in the browser and in Python, and how its weights are stored. - Checks: the bundle is loaded in the runtime that ships with it, every output is checked to be the right form, and sample inputs must reproduce the answers the Studio gave. It also measures the download size, the load time and the time per prediction, and warns about anything that looks like an email address, phone or card number in the examples or the model card.
- Publish: where it goes (below), the releases kept, and the link, QR code and embed code once it is live. A pipeline can do this on a schedule: see Publish Deployment in Pipeline steps.
The Deployment commands in the command palette (Ctrl+Shift+P) open the section you want, bring in a model file, or open a deployment by name, and the AI Copilot can list, check and (when you ask) publish a deployment.
Publishing
- Download gives the files of each target you ticked, ready to host anywhere.
- Hugging Face: a static Space (free) in your own account, or the model itself as a repository with its card. A Gradio or Docker Space runs a Python app, but Hugging Face needs a paid plan to create one. Sign in with Hugging Face in one popup, or paste a token.
- GitHub Pages: a repository in your account with Pages switched on, using the token in Settings. The Streamlit app can be pushed to a repository for Streamlit Community Cloud to deploy from.
- Project folder: the files written to
deploy/<name>/in your project, for your own source control.
A release you publish is kept, so an earlier one can be sent again with Roll back to this. When you train the model again, a banner on the Publish section offers the newer model with its accuracy beside the current one. See Deploying and publishing models for each step.
DLWAY hosts nothing
Everything is made in your browser and sent from your browser to your own account. DLWAY keeps no copy of the page or the model and passes no token on. A site you publish stays up until you take it down: Unpublish deletes it, and if Hugging Face does not let a sign-in delete, the screen links to the page where you can. Anyone who can open the page can also download the model, so do not publish one that must stay private.
Hugging Face models and pipeline packages
A model from the Hugging Face Hub needs no training: choose A Hugging Face model on the start screen, search for one that transformers.js can run (or start from a small one), read what the Hub says about it (does it run in a browser, its precisions and sizes, its licence, whether it is gated), and set up the page. Each task gets the form it needs: labels for zero-shot, a question and a passage, a microphone for speech, boxes drawn for detection, a conversation for chat. The model runs in a worker in the visitor's browser, the files can be copied into the page so it does not depend on the Hub, and the page is checked, previewed, published and rolled back like any other. Packages built by a pipeline's Build package step are listed on the left, each with a download.
Go deeper
See Deploying and publishing models, or follow Deploy and Publish a Model.