Native worker reference
Choose the worker interface
Section titled “Choose the worker interface”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.
Start a worker
Section titled “Start a worker”Install the terminal tools using the installation reference, then launch the appropriate worker with a prepared model:
stark generate --model-path /path/to/prepared-modelFor scoring:
stark score --score-model-path /path/to/prepared-modelThe paths are placeholders. Use an artifact prepared for the corresponding mode.
Follow the process lifecycle
Section titled “Follow the process lifecycle”- Read the readiness reply before sending a request.
- Write UTF-8 JSON-lines messages using the worker’s schema.
- Serialize complete request transactions against a loaded model.
- Consume streaming events through the terminal reply.
- Handle failure and process exit before admitting another request.
Do not treat worker stdout as ordinary application logging. It carries protocol messages.
Reference contracts
Section titled “Reference contracts”| 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.