Skip to content

Native worker reference

Use the HTTP API when the menu bar app should manage the running model and render chat templates.

Native workers expose inference over private stdin/stdout pipes. Your application owns process supervision, templates, tool execution and its agent loop. No Stark SDK package is published.

Install the terminal tools using the installation reference, then launch the appropriate worker with a prepared model:

Terminal window
stark generate --model-path /path/to/prepared-model

For scoring:

Terminal window
stark score --score-model-path /path/to/prepared-model

The paths are placeholders. Use an artifact prepared for the corresponding mode.

  1. Read the readiness reply before sending a request.
  2. Write UTF-8 JSON-lines messages using the worker’s schema.
  3. Serialize complete request transactions against a loaded model.
  4. Consume streaming events through the terminal reply.
  5. Handle failure and process exit before admitting another request.

Do not treat worker stdout as ordinary application logging. It carries protocol messages.

Reference Contents
Worker protocols Readiness, framing, versioning and shared errors
Generation Requests, streams, stops and cancellation
Scoring Candidate IDs, logits and probability definitions

Keep prompts, responses, token vectors and scoring probabilities out of logs. Artifact support and numerical qualification belong to the exact model and build being used.