Setting Up an AI Server
Read this page if you'll host an AI server or perform inference with a local server. If you plan to use the AI Hub for inference, go to Loading an AI Model to learn about loading models.
Starting an AI Server
PySDK can be used to configure and launch an AI server. The AI server allows you to run AI inferences on this AI server host initiated from remote clients.
You can start AI server process multiple ways:
running AI server from a terminal directly on the host OS.
running AI server as a Linux system service.
running AI server with a Docker container.
Terminal
To run the PySDK AI server from the terminal, perform the following steps:
Create or select a user name: Choose a user with administrative rights on the host.
Set up a Python virtual environment: For convenience and future maintenance, install PySDK in a Python virtual environment. Ensure Python and PySDK are installed in the virtual environment.
Create a directory for the local model zoo:
Download models to the local model zoo: If you want to host models locally (as opposed to using the public model zoo), download the models from the DeGirum AI Hub Model Zoo to the directory created earlier:
5. Start the AI server: Launch the server with the following command:
Linux Service
To automate the server launch so it starts on system boot, configure it as a Linux service:
Complete the terminal setup steps: Follow all steps in Starting AI Server from Terminal except for launching the server.
Create a systemd service configuration file: Create a file named
degirum.service
in the/etc/systemd/system
directory. Use the following template:
Start the service:
Check the service status:
5. Enable the service on startup:
Docker Container
To run the AI server as a Docker container, follow these steps:
Ensure Docker is installed: Refer to the official Docker documentation for installation instructions.
Prepare the local model zoo: If hosting models locally, create and populate the model zoo directory as described in Starting AI Server from Terminal.
Run the Docker container:
For hosting models locally:
For AI Hub-only hosting:
Rescanning Model Zoos
If you started your AI server in a terminal or as a Linux service, you can tell the AI server to rescan the local model zoo directory by executing the following command on the same host: degirum server rescan-zoo
If you started your AI server in the Docker container, then you should rescan the model zoo directory by restarting the container: docker restart <your_server_name>
Last updated
Was this helpful?