💻GenAI Stack API Server
You can simply run a CLI Command to setup GenAI Server, that will generate the script and default configuration files for the server. after that you can update the configuration files with your requirements
or you can manually setup by following below steps
Create a directory where you intend to set up your GenAI Server. Within this directory, add the following files:
main.py
: This Python script serves as the entry point for your GenAI Server.server.conf
: This configuration file contains settings related to your database.stack_config.json
: This JSON configuration file defines the components and their configurations for your server stack.
Configuration Files
server.conf
server.conf
Edit the server.conf
file to specify database-related settings.
database_name
: Set this to your preferred database name.database_driver
: Specify the database driver to sqlite. Currently, we only support sqlite.
stack_config.json
stack_config.json
Customize the stack_config.json
file to define the components for your GenAI Server stack.
Customize the components as needed.
Running the Server
main.py
:
main.py
:In
main.py
, you import two functions (read_configurations
andget_current_stack
) from thegenai_server
package to initialize your GenAI Server.Provide the path to the current folder where your configuration files reside.
read_configurations(path)
reads configurations fromserver.conf
andstack_config.json
at the specified path and returns two sets of configurations:server_configurations
: Specific to your GenAI Server.stack_configurations
: Default stack configurations fromstack_config.json
, defining the configurations required for the components to work together.
Pass
stack_configurations
toget_current_stack(config=stack_configurations)
. This function initializes your GenAI Server's stack based on these configurations. The stack is like a toolkit of components, each with its own settings, ready to serve your AI applications.
To start your GenAI Server, use the main.py
script. Open a terminal and navigate to the directory where main.py
is located. Then, execute the following command:
Your GenAI Server is now up and running, ready to serve AI-based applications and services!
Last updated