Elffuss BraidHub

kikocis/llama-stack public

main · 804 B · executableRawPermalink
1#!/bin/bash
2
3# Copyright (c) Meta Platforms, Inc. and affiliates.
4# All rights reserved.
5#
6# This source code is licensed under the terms described in the LICENSE file in
7# the root directory of this source tree.
8
9set -euo pipefail
10
11RED='\033[0;31m'
12NC='\033[0m' # No Color
13
14error_handler() {
15 echo "Error occurred in script at line: ${1}" >&2
16 exit 1
17}
18
19trap 'error_handler ${LINENO}' ERR
20
21if [ $# -lt 3 ]; then
22 echo "Usage: $0 <build_name> <yaml_config> <port> <script_args...>"
23 exit 1
24fi
25
26build_name="$1"
27env_name="llamastack-$build_name"
28shift
29
30yaml_config="$1"
31shift
32
33port="$1"
34shift
35
36eval "$(conda shell.bash hook)"
37conda deactivate && conda activate "$env_name"
38
39$CONDA_PREFIX/bin/python \
40 -m llama_stack.distribution.server.server \
41 --yaml_config "$yaml_config" \
42 --port "$port" "$@"