Sessions
Start
Use the Peer ID and Offer ID from your chosen offer. This example requests a five-minute lease (300 seconds). Choose a shorter duration if the provider’s limit is lower.
If you installed the consumer with Docker Compose, add --listen 127.0.0.1:18080 to the command below. This is the port the consumer relay uses to forward requests from the Docker host to your session.
weft sessions start --peer '<provider peer ID>' --offer '<offer ID>' --duration 300
Example output (selected fields):
Session 1AeTmAWHFZuDFfbUTGi2tb8VyF8RW3DoPr16ve3wwKuucd
Endpoint 127.0.0.1:37657
State Active
Lease duration 300s
Note the Session ID and Endpoint in the reply. By default, Weft picks a free loopback port. The session stays active after the command exits, so your application can send requests through the local endpoint.
Inspect
List your current sessions:
weft sessions list
Example output with one active session (selected fields):
SESSIONS
Session 1AeTmAWHFZuDFfbUTGi2tb8VyF8RW3DoPr16ve3wwKuucd
Provider 12D3KooWLpvPKJ1qCimv27wsN4fENm7wxRB5Ur76eSbhHPFrwJ7D
Endpoint 127.0.0.1:37657
State Active
Model hf://Qwen/Qwen2.5-1.5B-Instruct
Use weft sessions list --all to include recently ended sessions. Copy a session ID from the list to check its state, endpoint, estimated time remaining, and any last connection error:
weft sessions inspect '<session ID>'
Example output for the same session:
SESSIONS
Session 1AeTmAWHFZuDFfbUTGi2tb8VyF8RW3DoPr16ve3wwKuucd
Provider 12D3KooWLpvPKJ1qCimv27wsN4fENm7wxRB5Ur76eSbhHPFrwJ7D
Offer ID c67be19c374586d8
Allocation 1AcAQVzfjCbHmh7sL8hJELuHPZJSx9CmXXGB4adeqXxfUW
Endpoint 127.0.0.1:37657
State Active
Service chat-completion
Model hf://Qwen/Qwen2.5-1.5B-Instruct
Interface openai-chat-completions-v1
Lease duration 300s
Confirmation window 30s
Remaining (estimate) 299.994s
TCP bytes pass unchanged. Provider time governs hard tunnel expiry.
Shutdown
When you’re finished, stop the session to close the endpoint and release the provider’s backend:
weft sessions stop '<session ID>'
Inspect the session again and look for Stopped. If it remains Stopping, retry the stop command when the provider is reachable. The lease also expires at the end of its duration.