[{"data":1,"prerenderedAt":621},["ShallowReactive",2],{"page-\u002Fexamples\u002Fjupyterlab":3,"surround-\u002Fexamples\u002Fjupyterlab":612},{"id":4,"title":5,"body":6,"description":604,"extension":605,"meta":606,"navigation":607,"path":608,"seo":609,"stem":610,"__hash__":611},"docs\u002Fexamples\u002Fjupyterlab.md","Develop in JupyterLab",{"type":7,"value":8,"toc":595},"minimark",[9,13,18,30,34,115,119,389,402,406,416,422,432,459,463,473,522,533,537,540,567,571,591],[10,11,12],"p",{},"This example deploys a GPU instance from the PyTorch template with JupyterLab turned on, opens it in your browser, and keeps your notebooks on a network volume so they survive a stop.",[14,15,17],"h2",{"id":16},"what-you-need","What you need",[19,20,21],"ul",{},[22,23,24,25,29],"li",{},"A token to protect JupyterLab, for example from ",[26,27,28],"code",{},"openssl rand -hex 24",".",[14,31,33],{"id":32},"step-1-create-a-network-volume","Step 1: Create a network volume",[35,36,38,74],"tabs",{"sync":37},"interface",[39,40,42],"tabs-item",{"label":41},"Console",[10,43,44,45,54,55,59,60,63,64,67,68,71,72,29],{},"Open the ",[46,47,53],"a",{"href":48,"rel":49,"target":52},"https:\u002F\u002Fconsole.cloud.featherless.ai\u002Fstorage",[50,51],"noopener","noreferrer","_blank","Storage page",", click ",[56,57,58],"strong",{},"Create volume",", name it ",[26,61,62],{},"notebooks",", set ",[56,65,66],{},"Capacity"," to ",[26,69,70],{},"50",", and click ",[56,73,58],{},[39,75,77],{"label":76},"CLI",[78,79,84],"pre",{"className":80,"code":81,"language":82,"meta":83,"style":83},"language-bash shiki shiki-themes github-dark-default","featherless-cloud volume create notebooks --gb 50 --wait\n","bash","",[26,85,86],{"__ignoreMap":83},[87,88,91,95,99,102,105,109,112],"span",{"class":89,"line":90},"line",1,[87,92,94],{"class":93},"sQhOw","featherless-cloud",[87,96,98],{"class":97},"s9uIt"," volume",[87,100,101],{"class":97}," create",[87,103,104],{"class":97}," notebooks",[87,106,108],{"class":107},"sFSAA"," --gb",[87,110,111],{"class":107}," 50",[87,113,114],{"class":107}," --wait\n",[14,116,118],{"id":117},"step-2-deploy-the-instance","Step 2: Deploy the instance",[35,120,121,271],{"sync":37},[39,122,123],{"label":41},[124,125,127,132,152,156,170,174,192,196,205,209,215,257,261],"steps",{"level":126},"4",[128,129,131],"h4",{"id":130},"open-the-deploy-page","Open the deploy page",[10,133,44,134,139,140,143,144,147,148,151],{},[46,135,138],{"href":136,"rel":137,"target":52},"https:\u002F\u002Fconsole.cloud.featherless.ai\u002Finstances",[50,51],"Instances page"," and click ",[56,141,142],{},"Deploy instance",". Name the instance ",[26,145,146],{},"jupyter",". Keep the ",[56,149,150],{},"PyTorch (ROCm)"," template.",[128,153,155],{"id":154},"choose-compute","Choose compute",[10,157,158,159,162,163,166,167,29],{},"Under ",[56,160,161],{},"Compute",", choose a ",[56,164,165],{},"GPU model"," and ",[56,168,169],{},"1 GPU",[128,171,173],{"id":172},"mount-the-volume","Mount the volume",[10,175,158,176,54,179,182,183,185,186,189,190,29],{},[56,177,178],{},"Network volumes",[56,180,181],{},"Add network volume",", choose ",[26,184,62],{},", and keep the mount path ",[26,187,188],{},"\u002Fworkspace",". JupyterLab opens in ",[26,191,188],{},[128,193,195],{"id":194},"expose-jupyterlabs-port","Expose JupyterLab's port",[10,197,158,198,201,202,29],{},[56,199,200],{},"Public ports",", enter ",[26,203,204],{},"8888",[128,206,208],{"id":207},"turn-on-jupyterlab","Turn on JupyterLab",[10,210,158,211,214],{},[56,212,213],{},"Environment variables",", add:",[216,217,218,231],"table",{},[219,220,221],"thead",{},[222,223,224,228],"tr",{},[225,226,227],"th",{},"Name",[225,229,230],{},"Value",[232,233,234,247],"tbody",{},[222,235,236,242],{},[237,238,239],"td",{},[26,240,241],{},"ENABLE_JUPYTER",[237,243,244],{},[26,245,246],{},"true",[222,248,249,254],{},[237,250,251],{},[26,252,253],{},"JUPYTER_TOKEN",[237,255,256],{},"Your token",[128,258,260],{"id":259},"launch","Launch",[10,262,263,264,267,268,29],{},"Click ",[56,265,266],{},"Review launch",", then ",[56,269,270],{},"Launch instance",[39,272,273,382],{"label":76},[78,274,276],{"className":80,"code":275,"language":82,"meta":83,"style":83},"featherless-cloud instance create \\\n  --name jupyter \\\n  --template featherless\u002Frocm-pytorch \\\n  --gpu-count 1 \\\n  --volume notebooks:\u002Fworkspace \\\n  --port 8888 \\\n  --env ENABLE_JUPYTER=true \\\n  --env JUPYTER_TOKEN=\"$(openssl rand -hex 24)\"\n",[26,277,278,291,302,313,324,335,346,359],{"__ignoreMap":83},[87,279,280,282,285,287],{"class":89,"line":90},[87,281,94],{"class":93},[87,283,284],{"class":97}," instance",[87,286,101],{"class":97},[87,288,290],{"class":289},"suJrU"," \\\n",[87,292,294,297,300],{"class":89,"line":293},2,[87,295,296],{"class":107},"  --name",[87,298,299],{"class":97}," jupyter",[87,301,290],{"class":289},[87,303,305,308,311],{"class":89,"line":304},3,[87,306,307],{"class":107},"  --template",[87,309,310],{"class":97}," featherless\u002Frocm-pytorch",[87,312,290],{"class":289},[87,314,316,319,322],{"class":89,"line":315},4,[87,317,318],{"class":107},"  --gpu-count",[87,320,321],{"class":107}," 1",[87,323,290],{"class":289},[87,325,327,330,333],{"class":89,"line":326},5,[87,328,329],{"class":107},"  --volume",[87,331,332],{"class":97}," notebooks:\u002Fworkspace",[87,334,290],{"class":289},[87,336,338,341,344],{"class":89,"line":337},6,[87,339,340],{"class":107},"  --port",[87,342,343],{"class":107}," 8888",[87,345,290],{"class":289},[87,347,349,352,355,357],{"class":89,"line":348},7,[87,350,351],{"class":107},"  --env",[87,353,354],{"class":97}," ENABLE_JUPYTER=",[87,356,246],{"class":107},[87,358,290],{"class":289},[87,360,362,364,367,370,373,376,379],{"class":89,"line":361},8,[87,363,351],{"class":107},[87,365,366],{"class":97}," JUPYTER_TOKEN=\"$(",[87,368,369],{"class":93},"openssl",[87,371,372],{"class":97}," rand ",[87,374,375],{"class":107},"-hex",[87,377,378],{"class":107}," 24",[87,380,381],{"class":97},")\"\n",[10,383,384,385,388],{},"Keep the token you generated; you need it to sign in. ",[26,386,387],{},"featherless-cloud instance get jupyter"," prints the address of port 8888.",[390,391,392],"warning",{},[10,393,394,395,397,398,401],{},"Use an environment variable for ",[26,396,253],{},", not a secret variable: JupyterLab reads it from the environment. Members of your organization can see it on the instance's ",[56,399,400],{},"Details"," tab. Without a token, anyone with the address can run code on your instance.",[14,403,405],{"id":404},"step-3-open-jupyterlab","Step 3: Open JupyterLab",[10,407,408,409,412,413,415],{},"Once the instance is running, open its ",[56,410,411],{},"Connect"," tab and click the address listed for port ",[26,414,204],{},". Enter your token on the login page.",[10,417,418,419,29],{},"To skip the login page, add the token to the address: ",[26,420,421],{},"\u003Caddress>\u002Flab?token=\u003Cyour-token>",[10,423,424,425,427,428,431],{},"The file browser shows the contents of ",[26,426,62],{},". Check the GPU from a notebook cell; it prints ",[26,429,430],{},"True"," and the GPU's name:",[78,433,437],{"className":434,"code":435,"language":436,"meta":83,"style":83},"language-python shiki shiki-themes github-dark-default","import torch\ntorch.cuda.is_available(), torch.cuda.get_device_name(0)\n","python",[26,438,439,448],{"__ignoreMap":83},[87,440,441,444],{"class":89,"line":90},[87,442,443],{"class":289},"import",[87,445,447],{"class":446},"sZEs4"," torch\n",[87,449,450,453,456],{"class":89,"line":293},[87,451,452],{"class":446},"torch.cuda.is_available(), torch.cuda.get_device_name(",[87,454,455],{"class":107},"0",[87,457,458],{"class":446},")\n",[14,460,462],{"id":461},"step-4-stop-when-youre-done","Step 4: Stop when you're done",[10,464,465,466,468,469,472],{},"Stopping ends compute billing. Notebooks in ",[26,467,188],{}," stay on the volume; packages you installed with ",[26,470,471],{},"pip"," are on the container disk and are erased.",[35,474,475,492],{"sync":37},[39,476,477],{"label":41},[10,478,479,480,483,484,487,488,491],{},"Open the instance, click ",[56,481,482],{},"Stop",", and confirm with ",[56,485,486],{},"Stop instance",". Click ",[56,489,490],{},"Start"," to continue later.",[39,493,494],{"label":76},[78,495,497],{"className":80,"code":496,"language":82,"meta":83,"style":83},"featherless-cloud instance stop jupyter\nfeatherless-cloud instance start jupyter\n",[26,498,499,511],{"__ignoreMap":83},[87,500,501,503,505,508],{"class":89,"line":90},[87,502,94],{"class":93},[87,504,284],{"class":97},[87,506,507],{"class":97}," stop",[87,509,510],{"class":97}," jupyter\n",[87,512,513,515,517,520],{"class":89,"line":293},[87,514,94],{"class":93},[87,516,284],{"class":97},[87,518,519],{"class":97}," start",[87,521,510],{"class":97},[10,523,524,525,528,529,532],{},"To get your packages back after a stop, keep a ",[26,526,527],{},"requirements.txt"," on the volume and run ",[26,530,531],{},"pip install -r \u002Fworkspace\u002Frequirements.txt"," after each start.",[14,534,536],{"id":535},"clean-up","Clean up",[10,538,539],{},"Delete the instance, then the volume if you no longer need its files:",[78,541,543],{"className":80,"code":542,"language":82,"meta":83,"style":83},"featherless-cloud instance delete jupyter\nfeatherless-cloud volume delete notebooks\n",[26,544,545,556],{"__ignoreMap":83},[87,546,547,549,551,554],{"class":89,"line":90},[87,548,94],{"class":93},[87,550,284],{"class":97},[87,552,553],{"class":97}," delete",[87,555,510],{"class":97},[87,557,558,560,562,564],{"class":89,"line":293},[87,559,94],{"class":93},[87,561,98],{"class":97},[87,563,553],{"class":97},[87,565,566],{"class":97}," notebooks\n",[14,568,570],{"id":569},"next-steps","Next steps",[572,573,574,583],"card-group",{},[575,576,580],"card",{"icon":577,"title":578,"to":579},"i-lucide-globe","Expose ports","\u002Finstances\u002Fports",[10,581,582],{},"How public ports work.",[575,584,588],{"icon":585,"title":586,"to":587},"i-lucide-folder-up","Transfer files","\u002Fstorage\u002Ftransfer-files",[10,589,590],{},"Upload datasets to the volume.",[592,593,594],"style",{},"html pre.shiki code .sQhOw, html code.shiki .sQhOw{--shiki-default:#FFA657}html pre.shiki code .s9uIt, html code.shiki .s9uIt{--shiki-default:#A5D6FF}html pre.shiki code .sFSAA, html code.shiki .sFSAA{--shiki-default:#79C0FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .suJrU, html code.shiki .suJrU{--shiki-default:#FF7B72}html pre.shiki code .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}",{"title":83,"searchDepth":293,"depth":293,"links":596},[597,598,599,600,601,602,603],{"id":16,"depth":293,"text":17},{"id":32,"depth":293,"text":33},{"id":117,"depth":293,"text":118},{"id":404,"depth":293,"text":405},{"id":461,"depth":293,"text":462},{"id":535,"depth":293,"text":536},{"id":569,"depth":293,"text":570},"Develop in notebooks on a dedicated GPU, with work that survives restarts.","md",{},true,"\u002Fexamples\u002Fjupyterlab",{"title":5,"description":604},"examples\u002Fjupyterlab","WO737izdXMXRJimQgEn2J4-PcNKYmMeToARKbtfUFWw",[613,617],{"title":614,"path":615,"description":616},"Examples overview","\u002Fexamples","End-to-end guides for common AI workloads.",{"title":618,"path":619,"description":620},"Serve an LLM with vLLM","\u002Fexamples\u002Fvllm-server","Serve an open model behind an OpenAI-compatible API on your own GPU.",1794932598321]