Skip to content

Conversation

@W-Samik
Copy link

@W-Samik W-Samik commented Oct 14, 2025

Description

This PR adds the requested documention as well as a deployable vercel template that integrate gradio client by JS along with a vercel_template_guide.md to provide documentation of the template.

The changes due to this PR in order are as follows:-

  • added folder 'gradio_client' on path 'client/js/gradio_client'
  • added folder 'template' on path 'client/js/gradio_client/template' (following convention from path 'client/python/gradio_client/template')
  • added 'vercel_template_guide.md' markdown file to provide detailed procedure and documentation of the template along with used gradio official sources and links
  • added 'js_template.py' source code of the placeholder gradio app that was used as a online hosted median on hugging face to call from gradio client in the vercel template used.
  • added 'vercel_template.zip' a zip containg the source code of the vercel_template for the users to use and download if needed (the zip was created to maintain github repo integrity as it give git error when the source code is pushed directly)

points to take into consideration:-

delpoyable vercel template:-

hero
result
upload
Timeline.1.mov

Closes: #3800

AI Disclosure

We encourage the use of AI tooling in creating PRs, but the any non-trivial use of AI needs be disclosed. E.g. if you used Claude to write a first draft, you should mention that. Trivial tab-completion doesn't need to be disclosed. You should self-review all PRs, especially if they were generated with AI.

  • [✅] I used AI to make the front react with js along with the integrate gradio client to get inference in vercel_template.
  • [✅] I did not use AI 'vercel_template_guide.md' documentaion, 'js_template.py'.

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 14, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/b9de3b280fa94abbaa98293c80f0198797516270/gradio-5.49.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@b9de3b280fa94abbaa98293c80f0198797516270#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/b9de3b280fa94abbaa98293c80f0198797516270/gradio-client-1.19.1.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 14, 2025

🦄 no changes detected

This Pull Request does not include changes to any packages.

__No changes detected. __



‼️ Changeset not approved. Ensure the version bump is appropriate for all packages before approving.

  • Maintainers can approve the changeset by checking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can create the changelog file directly.

@freddyaboulton
Copy link
Collaborator

Hi @W-Samik ! Thank you for this nice contribution. I don't think we should add this template to the client/js repo. Instead, upload your code to a HuggingFace space or github repository. Then write a guide in the gradio-clients-and-lite section that explains this code. We can call the guide "Using the js client in vercel" or something like that.

Thank you!

@W-Samik
Copy link
Author

W-Samik commented Oct 14, 2025

Thank you for your review and feedback! @freddyaboulton Should I open a new issue for this contribution, or should I make the suggested changes and pr them through this existing issue?

@freddyaboulton
Copy link
Collaborator

Hi @W-Samik ! Please update this PR

@abidlabs
Copy link
Member

abidlabs commented Nov 6, 2025

Any update on this @W-Samik?

@W-Samik
Copy link
Author

W-Samik commented Nov 6, 2025

@abidlabs working on it will get done by the weekend for review.

@W-Samik
Copy link
Author

W-Samik commented Nov 6, 2025

@abidlabs @freddyaboulton the <guide.md> is shifted to the designated location guides/08_gradio_clients_and_lite section and all the assets and other resources are made avialiable at a single github repo as suggested, the changes have been made and is ready for review.

Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @W-Samik ! Thanks for addressing the previous feedback. The content is good but there are a lot of typos and the grammar could be improved. I've left some suggestions, but I would recommend reworking the whole draft.


Example: a background remover powered by ai.<br> (orginal -> background removed)

the code below is refers the gradio app we build for infrence at
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

The following code refers to the Gradio app built for inference:

the code below is refers the gradio app we build for infrence at
[app_template](https://github.com/W-Samik/Gradio-JS-Client-Vercel_Template-/blob/main/js_template.py)

check out resources to get a better grasp of how gradio works. [Gradio JS Client on NPM](https://www.npmjs.com/package/@gradio/client) , [Gradio Docs](https://gradio.app/docs/)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

Refer to these resources for a better understanding of how Gradio works


# **3. Hosting on Hugging Face**

Step 1: got to [hugging face spaces](https://huggingface.co/spaces/) (a platform host gradio app for inference free of cost)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion

Go to [Hugging Face Spaces]

demo.launch()
```

# **3. Hosting on Hugging Face**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to cover these steps. They are covered elsewhere. I would just link to the hugging face docs on spaces.


**RESULT**: On pushing the files your app will be deployed on the hugging face which you can use to make inference for your website

# 4. Making Inference Script
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an h3 (### Making Inference Script)


for demo purposes we will make a plain infrence script using gradio client for better understanding

<h2>Installation JS Gradio Client</h2>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need an <h2> here. Please just use prose, Install the JS client with the following lines:


**RESULT**: On pushing the files your app will be deployed on the hugging face which you can use to make inference for your website

# 4. Making Inference Script
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this section Using The Space Via the Client


# 5. Integrating Gradio Client in React website

make a github repo for the react website project or clone [template](https://github.com/W-Samik/background_remover) or download the [vercel_template.zip](https://github.com/W-Samik/Gradio-JS-Client-Vercel_Template-/blob/main/vercel_template.zip) from gradio github repository.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please capitalize all sentences

@@ -0,0 +1,231 @@

<div style="text-align: center;">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this logo


<i>we have achived a website that is easily integrated with the power of gradio js client to produce full functional production websites. </i>

<div style="text-align: center; margin-top: 50px;">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a bulleted list here instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS Client guide/Vercel templates

5 participants