Skip to content
GitHubLogin

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.

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_app
from 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=[],
)

If you serve an agent at /my-example-agent, the following endpoints will be automatically deployed for you.

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.

{
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: "... Response from the LLM.",
// Pass this value as an opaque token back in the request to
// continue the conversation.
state: "...",
usage: { ... }
}

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 parameterDefault valueDescription
llm_delta_eventstrueStreams the tokens from the final LLM response.
final_message_eventsfalseAt the end of the LLM response, send on last message with the full LLM response.
tool_call_eventstrueStream 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.

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.

TODO: Document the different types of events.

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.

Send a message via the websocket in JSON:

{
message: "... Your message here."
}

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: { ... }
}

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.

The websocket message is the exact same as the non-streaming endpoint.

Multiple websocket messages will be sent back with the different events streamed.

TODO: Document the different streaming events.