human

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README

Human

The world's slowest LLM. Astonishing reasoning. Terrible latency. Unionized.

An OpenAI/Anthropic-compatible model server where the model is a person.

简体中文

Your coding agent calls POST /v1/chat/completions like it always does. The request shows up in someone's browser. They read it, type an answer, maybe send back native tool calls for the agent to run in its own workspace, and hit deliver. The agent gets a normal SSE stream and is none the wiser.

One request, both sides

The browser is the Human's control room: conversation, native tool calls, Tasks, and reviewed workspace delivery.

Human operator console showing tool calls, Tasks, and workspace changes

The Agent side stays ordinary. Here OpenCode receives the plan and executes the file write in its own workspace.

OpenCode receiving a Human-generated plan and file change

Yes, we know how this sounds. We built an entire idempotent, crash-recovering, TLA+-verified pipeline so that a human can type "have you tried restarting it" at 2 tokens per second.

What it verifiably does (real-CLI test doors and all):

  • Human-in-the-loop where the human can actually do things: answer, ask back, run commands through the agent's own execution gate, edit files in a live mirror and deliver them as native write/edit calls. The working tree stays on the agent's side.
  • Wizard-of-Oz prototyping: your product doesn't have its AI yet? Ship a human. Protocol compatibility means existing agents, harnesses, and clients connect unchanged.

Other uses we're not comfortable putting in official documentation, so you'll have to discover them yourself. For instance: live-demoing "our in-house foundation model" to a client; taking over a stuck agent at 2am (assuming the gateway was set up beforehand, not at 2am while reading this README); recording your own model-seat sessions as evaluation data (it's all in SQLite, the export tool doesn't exist yet, you know what to do); and, should the A2A ecosystem ever want to hire an actual human — we happen to have an endpoint ready.

The plumbing is the serious part: fail-closed everywhere, byte-exact replay, durable remote-worker journals, 91 formal gates, fault-injection doors that run the real OpenCode CLI. See docs/ if that's your thing.

Run it

You need Go (or a release binary), a browser, and a human.

brew install vibe-agi/tap/human

Official release binaries and runtime CI currently cover macOS and Linux on amd64 and arm64. Windows remains compile-checked, but is not yet a supported runtime: its durable locking, ACL, path, and SQLite contracts do not have the same evidence, so we do not publish a misleading Windows binary.

human local --workspace ~/human-workspace

It prints the Human-side base working directory followed by two URLs:

Human workspace base: /home/human/human-workspace
model base URL: http://127.0.0.1:19080/v1
human side (browser): http://127.0.0.1:19081/?token=...

Open the second one. That's your inbox.

--workspace is only the base directory on the Human user's machine; it is not the Agent user's cwd. Every workspace-capable harness session gets a stable session-<hash> child by default. After accepting a request, the Human can switch that conversation to any existing repo in Web. The repo's current contents become the baseline, so switching never queues the whole repo for delivery. Human and Agent only agree that their two directories represent the same logical project: delivered tool calls use project-relative paths and the Agent resolves them in its own cwd. Absolute paths need not match and never cross the model protocol.

Then point an agent at the first one. OpenCode config:

// opencode.json
"human": {
  "npm": "@ai-sdk/openai-compatible",
  "name": "Human",
  "options": {
    "baseURL": "http://127.0.0.1:19080/v1",
    "apiKey": "{env:HUMAN_CALLER_TOKEN}"
  },
  "models": { "human-expert": { "name": "Human Expert" } }
}
export HUMAN_CALLER_TOKEN="$(human local credentials --workspace ~/human-workspace --token-only)"
opencode --model human/human-expert

If the Agent and Human are different OS users or machines, transfer the caller token through a secure channel. The Agent neither needs nor should know the Human working directory.

Ask it something. Your browser pings. You're the model now — take your time, the agent will wait.

No agent handy? curl works:

curl -N http://127.0.0.1:19080/v1/chat/completions \
  -H "Authorization: Bearer $HUMAN_CALLER_TOKEN" \
  -H "Content-Type: application/json" -H "Idempotency-Key: try-1" \
  -d '{"model":"human-expert","stream":true,"messages":[{"role":"user","content":"hello"}]}'

The curl hangs until you answer in the browser.

The same local endpoint also serves POST /v1/responses and POST /v1/messages. It accepts OpenAI-style Authorization: Bearer and Anthropic-style X-Api-Key; conflicting duplicate credentials fail closed. Wire compatibility is implemented for all three APIs. Harness-level claims are tracked separately: an API decoding successfully does not imply that every Workspace or tool feature of every CLI has been validated.

The core wire contract is also exercised through the official Go clients, currently pinned to openai-go/v3 v3.37.0 and anthropic-sdk-go v1.58.1: official client serialization enters Human, and the same clients decode its aggregate responses, SSE text and function/tool calls, tool-result continuations, standard error envelopes, and Anthropic count_tokens response. Compatibility intentionally targets model invocation, not every provider administration API or provider-hosted tool.

Remote setup is two commands: human gateway --listen :8080 on a server (put TLS in front), then human worker --gateway wss://.../internal/v1/worker/ws --caller-scope <caller-id> --workspace-scope <opaque-workspace-key> on the Human's machine. The scope binds that Human-owned mirror to one authenticated Agent-user workspace; it is not a directory path.

Embedding

human.NewLLM() / human.NewAgent() are transport-neutral cores. Store, auth, codecs, transports, and KMS are replaceable ports with public conformance suites in humantest; examples/custom-framework runs entirely on its own store, auth, and transport. The web UI is a stateless projection over the workerkit domain layer, so you can replace it too.

Docs: goals, gateway, embedding, operations, TLA+ model, framework contract, the human-side stack.

Status, honestly: all three advertised APIs now have a default product test for aggregate and streaming calls completed through the Web human API. Real-client gates give Claude Code 2.1.217, OpenCode 1.17.18, and Codex 0.145.0 the same baseline: final, second-process session resume, successful caller-side command, failed command result followed by recovery to final, and bounded Web rejection. Claude, OpenCode, and Codex additionally prove Workspace create and modify through their native file tools, with separate Human/Agent directories and byte-exact caller-side results. Codex uses the Responses custom freeform apply_patch tool and receives a Workspace profile only when the request declares the exact compatible tool and grammar. Through the structured Web Tasks panel, Claude runs TaskCreate → TaskUpdate → TaskList, while OpenCode todowrite and Codex update_plan each run pending→in-progress→completed continuations. The structured Web Command panel likewise uses exact, replaceable profiles for Claude Bash, OpenCode bash, and Codex exec_command; unknown versions, missing Codex model metadata, or behavioral schema drift fail closed to Chat/RemoteTools and the generic declared-tool editor. Claude and Codex also recover after a forced SSE disconnect following a complete Human progress frame; that evidence is not extrapolated to Workspace fault recovery. A separate Testcontainers gate pins all three CLIs in Linux; its independent direct-protocol layer also calls all three APIs in aggregate and streaming modes. Both layers route through the host local stack and can use a host OpenAI-compatible model as the Web operator; see the operations runbook.

Documentation

Overview

Package human exposes the two top-level Human framework surfaces.

NewLLM constructs the real-time, response-oriented HumanLLM correctness core. NewAgent constructs the durable, task-oriented HumanAgent core. Both are transport-neutral library objects: listeners, authentication, storage, encryption, worker clients, and user interfaces are explicit adapters owned by the embedding application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent = agent.Agent

Agent owns the durable HumanAgent task lifecycle. It does not start a listener or a worker transport; A2A and other transports are adapters over this domain object.

func NewAgent

func NewAgent(ctx context.Context, config AgentConfig) (*Agent, error)

NewAgent opens or recovers the task-oriented HumanAgent surface. ctx controls only this open operation; after NewAgent returns, method contexts and Shutdown own the Agent lifetime. HumanAgent shares message and workspace concepts with HumanLLM, but not completion request, stream, or timeout state.

type AgentConfig

type AgentConfig = agent.Config

AgentConfig configures the durable, task-oriented HumanAgent surface. Store is required and may be any implementation of agent.Store. NewAgent never chooses a physical driver or creates hidden process-global state.

func DefaultAgentConfig

func DefaultAgentConfig() AgentConfig

DefaultAgentConfig returns the durable Agent defaults without selecting a persistence identity. Set Store before calling NewAgent.

type LLM

type LLM = llm.Service

LLM is the transport-neutral HumanLLM correctness core. It owns no HTTP listener, authentication system, WebSocket endpoint, terminal UI, or hidden process-global state. Caller and worker transports borrow it through the public llm.CallerEndpoint and llm.WorkerEndpoint ports.

func NewLLM

func NewLLM(ctx context.Context, config LLMConfig) (*LLM, error)

NewLLM validates the injected contracts, recovers durable in-flight work, and starts the transport-neutral HumanLLM core. ctx bounds construction and recovery only; method contexts and Shutdown control its subsequent lifetime.

type LLMConfig

type LLMConfig = llm.Config

LLMConfig composes the real-time HumanLLM core. Store and DeploymentID are deliberately required deployment choices. Every other port can be replaced independently; framework.Resource records whether Human owns or merely borrows each stateful dependency.

func DefaultLLMConfig

func DefaultLLMConfig() LLMConfig

DefaultLLMConfig returns the built-in OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages codecs together with the explicit llm.AdmitAll admission policy. It intentionally leaves Store and DeploymentID unset so an embedder must choose a durable identity explicitly; replace Admission when the deployment needs policy beyond transport authentication. The returned values are fresh and may be replaced or extended.

Directories

Path Synopsis
Package a2a exposes the HTTP+JSON binding for the durable HumanAgent surface.
Package a2a exposes the HTTP+JSON binding for the durable HumanAgent surface.
Package agent implements the durable, task-oriented HumanAgent surface.
Package agent implements the durable, task-oriented HumanAgent surface.
sqlite
Package sqlite provides the official local SQLite adapter for agent.Store.
Package sqlite provides the official local SQLite adapter for agent.Store.
workerws
Package workerws implements the official WebSocket adapter for the public HumanAgent WorkerTransport port.
Package workerws implements the official WebSocket adapter for the public HumanAgent WorkerTransport port.
workerws/sqlite
Package sqlite provides the official durable SQLite implementation of the Agent remote-worker Journal port.
Package sqlite provides the official durable SQLite implementation of the Agent remote-worker Journal port.
cmd
human command
examples
custom-framework/customprotect
Package customprotect demonstrates an application-owned protect.Protector adapter.
Package customprotect demonstrates an application-owned protect.Protector adapter.
custom-framework/customstore
Package customstore demonstrates two application-owned llm.Store adapters: a durable single-file Store opened with Open, and an optional policy middleware opened with Own or Borrow.
Package customstore demonstrates two application-owned llm.Store adapters: a durable single-file Store opened with Open, and an optional policy middleware opened with Own or Borrow.
embed-a2a command
Command embed-a2a demonstrates mounting HumanAgent's A2A 1.0 HTTP+JSON caller surface inside an application-owned router.
Command embed-a2a demonstrates mounting HumanAgent's A2A 1.0 HTTP+JSON caller surface inside an application-owned router.
embed-agent command
Command embed-agent demonstrates the durable HumanAgent domain facade.
Command embed-agent demonstrates the durable HumanAgent domain facade.
embed-gateway command
Command embed-gateway demonstrates mounting Human's model and worker handlers in an application's HTTP server with application-owned identity and tenant-to-worker routing.
Command embed-gateway demonstrates mounting Human's model and worker handlers in an application's HTTP server with application-owned identity and tenant-to-worker routing.
embed-local command
Command embed-local starts a complete Human instance inside another Go process: loopback model API, SQLite service, worker, and browser human side.
Command embed-local starts a complete Human instance inside another Go process: loopback model API, SQLite service, worker, and browser human side.
Package framework contains the small cross-surface contracts used to compose HumanLLM and HumanAgent without hiding resource ownership.
Package framework contains the small cross-surface contracts used to compose HumanLLM and HumanAgent without hiding resource ownership.
Package gateway provides an embeddable Human Agent model gateway.
Package gateway provides an embeddable Human Agent model gateway.
Package humantest provides reusable black-box conformance suites for Human framework ports.
Package humantest provides reusable black-box conformance suites for Human framework ports.
internal
auth
Package auth issues and verifies caller API tokens without storing secrets.
Package auth issues and verifies caller API tokens without storing secrets.
buildinfo
Package buildinfo exposes release metadata injected by the build pipeline.
Package buildinfo exposes release metadata injected by the build pipeline.
callerfs
Package callerfs enforces the caller-side filesystem boundary and CAS edits.
Package callerfs enforces the caller-side filesystem boundary and CAS edits.
callershim
Package callershim provides the demand-side execution boundary for the project-owned completion-mode harness adapter.
Package callershim provides the demand-side execution boundary for the project-owned completion-mode harness adapter.
completion/adapter
Package adapter contains explicit, versioned harness capability profiles.
Package adapter contains explicit, versioned harness capability profiles.
completion/canonical
Package canonical defines the dialect-neutral model used by completion APIs.
Package canonical defines the dialect-neutral model used by completion APIs.
completion/dialect
Package dialect defines the pure wire-codec boundary for model APIs.
Package dialect defines the pure wire-codec boundary for model APIs.
completion/dialect/anthropic
Package anthropic implements the Anthropic Messages wire dialect.
Package anthropic implements the Anthropic Messages wire dialect.
completion/dialect/openai
Package openai implements the OpenAI Chat Completions wire dialect.
Package openai implements the OpenAI Chat Completions wire dialect.
completion/dialect/responses
Package responses implements the OpenAI Responses API wire dialect.
Package responses implements the OpenAI Responses API wire dialect.
completion/gateway
Package gateway implements the synchronous, model-compatible completion gateway.
Package gateway implements the synchronous, model-compatible completion gateway.
completion/hub
Package hub provides the in-process worker queue used by gateway.
Package hub provides the in-process worker queue used by gateway.
completion/safety
Package safety implements gateway-side lexical defense and warning labels.
Package safety implements gateway-side lexical defense and warning labels.
gatewaycmd
Package gatewaycmd assembles the standalone gateway and administration CLI.
Package gatewaycmd assembles the standalone gateway and administration CLI.
humancmd
Package humancmd assembles the human worker TUI command.
Package humancmd assembles the human worker TUI command.
mirror
Package mirror manages the worker-side scratch copy used by completion mode.
Package mirror manages the worker-side scratch copy used by completion mode.
ownerlock
Package ownerlock provides a process-lifetime, cross-process ownership lock for a canonical file-backed SQLite location.
Package ownerlock provides a process-lifetime, cross-process ownership lock for a canonical file-backed SQLite location.
ratelimit
Package ratelimit provides an in-memory, per-key admission limiter.
Package ratelimit provides an in-memory, per-key admission limiter.
sqlitefile
Package sqlitefile secures file-backed SQLite databases before a driver opens them.
Package sqlitefile secures file-backed SQLite databases before a driver opens them.
store
Package store defines persistence contracts for completion requests.
Package store defines persistence contracts for completion requests.
store/sqlite
Package sqlite implements the shared Store contracts using pure-Go SQLite.
Package sqlite implements the shared Store contracts using pure-Go SQLite.
userdata
Package userdata resolves Human's private, per-user durable state.
Package userdata resolves Human's private, per-user durable state.
workerbridge
Package workerbridge adapts the frozen legacy worker WebSocket client to the public workerkit.Wire port, so the shipped products (human local, human worker) can run the web human side against the existing gateway while the caller half of dual-stack convergence is still pending.
Package workerbridge adapts the frozen legacy worker WebSocket client to the public workerkit.Wire port, so the shipped products (human local, human worker) can run the web human side against the existing gateway while the caller half of dual-stack convergence is still pending.
workerclient
Package workerclient implements the human TUI side of the private worker WS.
Package workerclient implements the human TUI side of the private worker WS.
workerproto
Package workerproto defines the private, versioned gateway-to-TUI protocol.
Package workerproto defines the private, versioned gateway-to-TUI protocol.
workerstate
Package workerstate persists worker-side UI state that must survive a disconnect or process restart.
Package workerstate persists worker-side UI state that must survive a disconnect or process restart.
workerws
Package workerws exposes the private WebSocket transport used by human TUI.
Package workerws exposes the private WebSocket transport used by human TUI.
llm
Package llm defines the public, dialect-neutral contracts used by HumanLLM.
Package llm defines the public, dialect-neutral contracts used by HumanLLM.
builtin
Package builtin exposes HumanLLM's built-in model-API codecs through the public llm.Codec port.
Package builtin exposes HumanLLM's built-in model-API codecs through the public llm.Codec port.
callerhttp
Package callerhttp provides the official HTTP caller transport for HumanLLM.
Package callerhttp provides the official HTTP caller transport for HumanLLM.
callerhttp/bearerauth
Package bearerauth is HumanLLM's basic caller Authenticator: it accepts a single shared token using the OpenAI Authorization bearer convention or the Anthropic X-Api-Key convention, and attributes every accepted request to one fixed CallerID.
Package bearerauth is HumanLLM's basic caller Authenticator: it accepts a single shared token using the OpenAI Authorization bearer convention or the Anthropic X-Api-Key convention, and attributes every accepted request to one fixed CallerID.
callerhttp/harnessresolver
Package harnessresolver is HumanLLM's basic caller-side RequestResolver: it maps the exact session identity emitted by recognized coding harnesses onto the transport-neutral llm.TaskContext, and derives a stable idempotency key for a harness turn so a dropped-socket retry dedups instead of forking work.
Package harnessresolver is HumanLLM's basic caller-side RequestResolver: it maps the exact session identity emitted by recognized coding harnesses onto the transport-neutral llm.TaskContext, and derives a stable idempotency key for a harness turn so a dropped-socket retry dedups instead of forking work.
sqlite
Package sqlite is HumanLLM's official single-process SQLite Store adapter.
Package sqlite is HumanLLM's official single-process SQLite Store adapter.
workerws
Package workerws implements the official WebSocket adapter for the public HumanLLM WorkerTransport port.
Package workerws implements the official WebSocket adapter for the public HumanLLM WorkerTransport port.
workerws/sqlite
Package sqlite provides the official durable SQLite implementation of the HumanLLM remote-worker Journal port.
Package sqlite provides the official durable SQLite implementation of the HumanLLM remote-worker Journal port.
Package local runs the batteries-included HumanLLM desktop composition in one process: a loopback caller endpoint, an SQLite-backed llm.Service, and a browser human side connected in-process through workerkit.
Package local runs the batteries-included HumanLLM desktop composition in one process: a loopback caller endpoint, an SQLite-backed llm.Service, and a browser human side connected in-process through workerkit.
Package observe defines the shared observability port for Human runtimes.
Package observe defines the shared observability port for Human runtimes.
Package protect defines the provider-neutral payload protection port used by Human runtimes.
Package protect defines the provider-neutral payload protection port used by Human runtimes.
aead
Package aead provides Human's local, in-memory AES-256-GCM Protector.
Package aead provides Human's local, in-memory AES-256-GCM Protector.
Package web is the official browser UI for the Human worker.
Package web is the official browser UI for the Human worker.
Package workerkit is the headless human-side domain layer of HumanLLM.
Package workerkit is the headless human-side domain layer of HumanLLM.
fsmirror
Package fsmirror is the official filesystem Mirror adapter for workerkit.
Package fsmirror is the official filesystem Mirror adapter for workerkit.
sqlite
Package sqlite provides the official durable SQLite implementation of the workerkit StateStore port.
Package sqlite provides the official durable SQLite implementation of the workerkit StateStore port.
Package workspace contains transport-neutral identities and the replaceable caller-side Store used to apply HumanAgent artifacts.
Package workspace contains transport-neutral identities and the replaceable caller-side Store used to apply HumanAgent artifacts.
sqlite
Package sqlite provides the official single-owner SQLite implementation of workspace.Store.
Package sqlite provides the official single-owner SQLite implementation of workspace.Store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL