Skip to content

Overview

Utility functions for the server.

uaiBrainServer.routes.utilityRoutes.pingServer()

Ping the server to check if it is running.

API Route: /ping

API Methods: GET

Returns:

Name Type Description
pid str

The process ID of the server. Usefull for debugging.

uaiBrainServer.routes.imageSDRoutes.changeModelImage()

Change the Stable Diffusion model to a new model.

Formatted as a JSON request

API Route: /changeModel/image

API Methods: POST

Parameters:

Name Type Description Default
modelName str

The model to use for generation

required

Returns:

Name Type Description
string str

"Changed model to " + modelName

uaiBrainServer.routes.textRoutes.changeModel()

Change the GPT3 model to a new model.

Formatted as a JSON request

API Route: /changeModel/chat

API Methods: POST

Parameters:

Name Type Description Default
modelName str

The model to use for generation

required
device str

The device to use for generation, either "cuda" or "cpu"

required

Returns:

Name Type Description
fortune str

Returns a fortune generated from the new model.

uaiBrainServer.routes.imageSDRoutes.CleanPipeSD()

Clear the Stable Diffusion GPU Cache and purge the model. This is useful if you are running out of GPU memory.

API Route: /image/pipe/clear

API Methods: GET

Returns:

Name Type Description
string str

Cache Cleared

uaiBrainServer.routes.utilityRoutes.shutdownServer()

Shutdown the server

API Route: /shutdown

API Methods: GET

Returns:

Name Type Description
json str

{ "success": True, "message": "Server is shutting down..." }