If you prefer a visual interface or want to deploy standard HTTP functions without setting up a local agent environment, use the Buildfunctions Dashboard.
Navigate to the Functions section and click the New tab.Simply click Deploy Function to immediately deploy a standard “Hello World” handler. You can also write your own code directly in the browser editor and deploy it.
Advanced: GPU Functions
To deploy a GPU function, select the GPU option when creating a function and use one of these templates:
Config: Runtime: Python, Memory: 10000 MB, vCPUs: 6, Timeout: 120 seconds, and torch in requirements.txt
import sysimport jsonimport timeimport torchMOCK_RESPONSE = "The most mysterious phenomenon in the universe is dark energy..."async def stream_mock_response(): try: yield b"<<START_STREAM>>\n" for i, word in enumerate(MOCK_RESPONSE.split()): token = f" {word}" if i > 0 else word yield f"<<STREAM_CHUNK>>{token}<<END_STREAM_CHUNK>>\n".encode() time.sleep(0.05) yield b"<<END_STREAM>>\n" except Exception as e: yield b"<<STREAM_ERROR>>\n"async def async_stream_wrapper(): async for chunk in stream_mock_response(): yield chunkdef handler(): try: cuda_available = torch.cuda.is_available() device_name = torch.cuda.get_device_name(0) if cuda_available else "No GPU" return { "statusCode": 200, "headers": { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", "X-Device-Name": device_name }, "body": async_stream_wrapper(), } except Exception as e: return {"statusCode": 500, "body": {"error": "Internal Server Error"}}
3
Test Your Endpoint
Once deployed, click on your function and navigate to the Network tab.Here you will see your active Test Endpoints. You can hit this endpoint with any HTTP client to trigger the function.