{"id":28384437,"url":"https://github.com/runpod-workers/worker-template","last_synced_at":"2025-06-25T23:31:06.988Z","repository":{"id":157638560,"uuid":"633496364","full_name":"runpod-workers/worker-template","owner":"runpod-workers","description":"Starting point to build your own custom serverless endpoint","archived":false,"fork":false,"pushed_at":"2025-05-09T08:18:50.000Z","size":184,"stargazers_count":107,"open_issues_count":3,"forks_count":76,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-30T09:27:15.266Z","etag":null,"topics":["docker","gpu","runpod","serverless"],"latest_commit_sha":null,"homepage":"https://docs.runpod.io/serverless/get-started","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/runpod-workers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-27T16:15:13.000Z","updated_at":"2025-05-29T11:27:12.000Z","dependencies_parsed_at":"2023-12-08T10:29:03.603Z","dependency_job_id":"51b772db-4025-4d6f-9e7a-e6eead255ee0","html_url":"https://github.com/runpod-workers/worker-template","commit_stats":null,"previous_names":[],"tags_count":14,"template":true,"template_full_name":null,"purl":"pkg:github/runpod-workers/worker-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod-workers%2Fworker-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod-workers%2Fworker-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod-workers%2Fworker-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod-workers%2Fworker-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runpod-workers","download_url":"https://codeload.github.com/runpod-workers/worker-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runpod-workers%2Fworker-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261972577,"owners_count":23238537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","gpu","runpod","serverless"],"created_at":"2025-05-30T08:38:39.069Z","updated_at":"2025-06-25T23:31:06.977Z","avatar_url":"https://github.com/runpod-workers.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![RunPod Worker Template](https://cpjrphpz3t5wbwfe.public.blob.vercel-storage.com/worker-template_banner-zUuCAjwDuvfsINR6vKBhYvvm3TnZFB.jpeg)\n\n---\n\nThis repository serves as a starting point for creating your own custom RunPod Serverless worker. It provides a basic structure and configuration that you can build upon.\n\n---\n\n[![RunPod](https://api.runpod.io/badge/runpod-workers/worker-template)](https://www.runpod.io/console/hub/runpod-workers/worker-template)\n\n---\n\n## Getting Started\n\n1.  **Use this template:** Create a new repository based on this template or clone it directly.\n2.  **Customize:** Modify the code and configuration files to implement your specific task.\n3.  **Test:** Run your worker locally to ensure it functions correctly.\n4.  **Deploy:** Connect your repository to RunPod or build and push the Docker image manually.\n\n## Customizing Your Worker\n\n- **`handler.py`:** This is the core of your worker.\n  - The `handler(event)` function is the entry point executed for each job.\n  - The `event` dictionary contains the job input under the `\"input\"` key.\n  - Modify this function to load your models, process the input and return the desired output.\n  - Consider implementing model loading outside the handler (e.g., globally or in an initialization function) if models are large and reused across jobs.\n- **`requirements.txt`:** Add any Python libraries your worker needs to this file. These will be installed via `uv` when the Docker image is built.\n- **`Dockerfile`:**\n  - This file defines the Docker image for your worker.\n  - It starts from a [RunPod base image (`runpod/base`)](https://github.com/runpod/containers/tree/main/official-templates/base) which includes CUDA, mulitple versions of python, uv, jupyter notebook and common dependencies.\n  - It installs dependencies from `requirements.txt` using `uv`.\n  - It copies your `src` directory into the image.\n  - You might need to add system dependencies (`apt-get install ...`), environment variables (`ENV`), or other setup steps here if required by your specific application.\n- **`test_input.json`:** Modify this file to provide relevant sample input for local testing.\n\n## Testing Locally\n\nYou can test your handler logic locally using the RunPod Python SDK. For detailed steps on setting up your local environment (creating a virtual environment, installing dependencies) and running the handler, please refer to the [RunPod Serverless Get Started Guide](https://docs.runpod.io/serverless/get-started).\n\n1.  **Prepare Input:** Modify `test_input.json` with relevant sample input for your handler.\n2.  **Run the Handler:**\n    ```bash\n    python handler.py\n    ```\n    This will execute your `handler` function with the contents of [`test_input.json`](/test_input.json) as input.\n\n## Deploying to RunPod\n\nThere are two main ways to deploy your worker:\n\n1.  **GitHub Integration (Recommended):**\n\n    - Connect your GitHub repository to RunPod Serverless. RunPod will automatically build and deploy your worker whenever you push changes to your specified branch.\n    - For detailed instructions on setting up the GitHub integration, authorizing RunPod, and configuring your deployment, please refer to the [RunPod Deploy with GitHub Guide](https://docs.runpod.io/serverless/github-integration).\n\n2.  **Manual Docker Build \u0026 Push:**\n    - For detailed instructions on building the Docker image locally and pushing it to a container registry, please see the [RunPod Serverless Get Started Guide](https://docs.runpod.io/serverless/get-started#step-6-build-and-push-your-docker-image).\n    - Once pushed, create a new Template or Endpoint in the RunPod Serverless UI and point it to the image in your container registry.\n\n## Further Information\n\n- [RunPod Serverless Documentation](https://docs.runpod.io/serverless/overview)\n- [Python SDK](https://github.com/runpod/runpod-python)\n- [Base Docker Images](https://github.com/runpod/containers/tree/main/official-templates/base)\n- [Community Discord](https://discord.gg/cUpRmau42Vd)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunpod-workers%2Fworker-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunpod-workers%2Fworker-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunpod-workers%2Fworker-template/lists"}