WorkerSettings

org.llm4s.agent.service.WorkerSettings
See theWorkerSettings companion object
@Experimental
final case class WorkerSettings

How an AgentWorker runs (Stage 5 W2, design 4.56), loaded from llm4s.agent.worker by WorkerConfigLoader:

  • concurrency: the most runs the worker has at once (default 4).
  • pollInterval: how long the worker waits before it asks the queue again once it found nothing to take (default 1 second), and how long it passes over an entry it deferred to a live run on the thread.
  • unrunnableAfter: how long an entry may wait for a worker whose graph version can restore its thread before a worker that cannot closes it Failed(Unrunnable) (default 1 hour): long enough for a rolling upgrade's old workers to finish their runs. Judged by the store's clock, from the entry's submission or its latest attempt.
  • drainGrace: on shutdown, how long running runs have to reach a suspension or their end before the worker cancels them (default 30 seconds).
  • exitTimeout: how long a cancelled run then has to exit before the worker gives up on it (default 10 seconds). A run that has not exited keeps its claim and lease, which expire after their ttl once the process exits.
  • sweepEvery: how often the worker runs the store-wide retention sweep (Checkpointer.sweep) and reclaims closed entries past their ticket lifetime (RunQueue.reclaim), one instance of the fleet at a time; None turns the sweep off (default 5 minutes).
  • sweep: what the sweep prunes and reclaims (SweepPolicy; default SweepPolicy.keepAll, which prunes nothing, so the sweep only reclaims expired queue entries).
  • label: names the worker in its lease holder and its logs, such as a host or pod name; a random suffix keeps two workers with one label apart.

Every duration must be positive, concurrency at least 1 and a label not blank: apply and the with* setters throw IllegalArgumentException otherwise, and WorkerSettings.of returns a ValidationError.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def withDrainGrace(d: FiniteDuration): WorkerSettings
def withExitTimeout(d: FiniteDuration): WorkerSettings
def withLabel(l: String): WorkerSettings
def withLabel(l: Option[String]): WorkerSettings
def withPollInterval(d: FiniteDuration): WorkerSettings
def withSweepEvery(d: FiniteDuration): WorkerSettings
def withSweepEvery(d: Option[FiniteDuration]): WorkerSettings
def withUnrunnableAfter(d: FiniteDuration): WorkerSettings

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product