skip to content

Server

Serve an AI app over HTTP.

Sofuu has an HTTP server built in. Handle a request, stream the model's answer, and compile the service into one binary.

The server is part of the runtime.

The handler, the model, and the tools share one process.

HTTP

Create a server with sofuu.http.createServer.

Streaming

Send model output as it arrives over SSE or plain text.

Small builds

Compile a service with the micro profile, around 2 MB.

In code

Write the answer as it arrives.

The model stream and the HTTP response are in the same process, so you can pass chunks straight through.

server.jsjavascript

const server = sofuu.http.createServer(async (req, res) => {  const stream = sofuu.ai.stream("Explain SIMD in simple terms.");  for await (const chunk of stream) res.write(chunk.text);  res.end();}); server.listen(3000);

FAQ

Common questions.

HTTP, streaming, and builds.

Do I need Express?

No. The HTTP server is built in.

Can I put it behind nginx?

Yes. It listens on the interface you choose.

Does it work with OpenAI clients?

Yes. sofuu serve --brain opens an OpenAI-compatible endpoint backed by memory.

Ship a service

Put the app behind a URL.

Write a handler, stream the answer, and compile it.

$ curl -fsSL https://sofuu.xyz/install | sh