Agent SDK Deploying on 8080 Edge
Deploy the agents built using the 8080 SDK on the 8080 Edge platform.
You can greatly simplify your infrastructure and state management by deploying the agents built using the 8080 SDK on the 8080 Edge platform.
Deploy
Section titled “Deploy”With the 8080 SDK, you can deploy an agent like you define an endpoint. Doing so automatically creates HTTP and WS endpoints with predefined request and response types.
from e80_sdk import Eighty80, eighty80_appfrom e80_sdk.agents.data import Agent, State, Message
app = eighty80_app()
@app.serve_agent("/my-example-agent")def test_agent(): return Agent( name="Comedian Agent", model="openrouter/qwen/qwen3-32b", instructions="You are a comedian.", tools=[], )Endpoints Deployed
Section titled “Endpoints Deployed”If you serve an agent at /my-example-agent, the following endpoints will be
automatically deployed for you.
HTTP stateless endpoint
Section titled “HTTP stateless endpoint”If you serve an agent at /my-example-agent, an HTTP POST endpoint at /my-example-agent will
handle stateless requests. It is stateless because the endpoint does not store the state anywhere,
and you will be responsible for passing the state back and forth.
Request format
Section titled “Request format”{ message: "Tell me a joke about animals.",
// Optional // To continue a conversation, pass the "state" value from the response. // If this is the first message, you can omit this value. state: "...",}Response format
Section titled “Response format”{ response: "... Response from the LLM.",
// Pass this value as an opaque token back in the request to // continue the conversation. state: "...",
usage: { ... }}HTTP streaming stateless endpoint
Section titled “HTTP streaming stateless endpoint”If you serve an agent at /my-example-agent, an HTTP POST endpoint at /my-example-agent/stream
will handle stateless requests like the non-streaming endpoint, but stream events via SSE.
To control which events you get, you can use the following query parameters:
| Query parameter | Default value | Description |
|---|---|---|
llm_delta_events | true | Streams the tokens from the final LLM response. |
final_message_events | false | At the end of the LLM response, send on last message with the full LLM response. |
tool_call_events | true | Stream an event when a tool is called, and when a tool returns. |
You will always get a turn_finished event, which includes the usage and state values which you can pass back into the
endpoint to continue the conversation.
Request format
Section titled “Request format”The request format is the exact same as the non-streaming endpoint. To get the value to pass in to state,
wait for the turn_finished event.
Response format
Section titled “Response format”TODO: Document the different types of events.
Websocket stateful endpoint
Section titled “Websocket stateful endpoint”If you serve an agent at /my-example-agent, a Websocket endpoint at /my-example-agent/ws will
serve a stateful Websocket endpoint. The endpoint is stateful because you do not need to
pass the state back and forth, the state will be preserved as long as the connection is open and you
can take multiple turns.
Request format
Section titled “Request format”Send a message via the websocket in JSON:
{ message: "... Your message here."}Response format
Section titled “Response format”After you send your message, wait for a response message via the Websocket. It will arrive via JSON in the following format:
{ response: "... LLM response here." // The usage for this turn only. usage: { ... }}Websocket stateful streaming endpoint
Section titled “Websocket stateful streaming endpoint”If you serve an agent at /my-example-agent, a Websocket endpoint at /my-example-agent/ws/stream will
serve a stateful Websocket endpoint that streams events. The endpoint is stateful because you do not need to
pass the state back and forth, the state will be preserved as long as the connection is open and you
can take multiple turns.
You can control which events are returned via query params. The query params are the exact same as the HTTP streaming endpoint.
Request format
Section titled “Request format”The websocket message is the exact same as the non-streaming endpoint.
Response format
Section titled “Response format”Multiple websocket messages will be sent back with the different events streamed.
TODO: Document the different streaming events.