Skip to main content

Introduction

The Base Worker can be used as a standalone component or as part of a cluster managed by the Load Balancer. You can run and interact with your Workers directly for simple or single-instance use cases, or add an aditional Load Balancer. Duplicating the Base Worker to start building a Worker is the easiest way to start adding value!

When used with the Load Balancer, you gain additional features such as persistent task queues, advanced routing, and a monitoring dashboard – but these are entirely optional.

The code for both the Load Balancer and Workers is written in TypeScript for reliability and maintainability. However, Workers are technology-agnostic: your TypeScript code can interact with binaries, call Python scripts, or use any other technology required for your business logic.

The Base Worker inherits all its core features—such as orchestration, slot management, monitoring, and API endpoints—from the underlying Worker Core engine.

What is the Base Worker?

The Base Worker is a template for creating specialized Workers. It handles all the orchestration, slot management, and optionally communication with the Load Balancer, so you can focus on implementing your own functions, services, and helpers.

  • Add your business logic in functions/
  • Manage internal services in services/
  • Support your code with helpers in helpers/
  • Expose dynamic tags in tags/

You create your files in these folders and that's it!

Key Concepts

  • Functions: Business logic units, fully customizable
  • Services: Manage internal lifecycles (e.g., Chrome, Llama.cpp)
  • Helpers: Utility classes for your functions/services
  • Tags: Real-time metadata exposed by the Worker, intended for the Load Balancer dashboard
  • Slots: Your Workers provide slots for tasks that can be carried out in parallel. You choose the number of slots according to the performance required.