Elffuss BraidHub

kikocis/llama-stack public

cd503abf3090 · 897 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
9DOCKER_BINARY=${DOCKER_BINARY:-docker}
10DOCKER_OPTS=${DOCKER_OPTS:-}
11
12set -euo pipefail
13
14RED='\033[0;31m'
15NC='\033[0m' # No Color
16
17error_handler() {
18 echo "Error occurred in script at line: ${1}" >&2
19 exit 1
20}
21
22trap 'error_handler ${LINENO}' ERR
23
24if [ $# -lt 3 ]; then
25 echo "Usage: $0 <build_name> <yaml_config> <port> <other_args...>"
26 exit 1
27fi
28
29build_name="$1"
30docker_image="llamastack-$build_name"
31shift
32
33yaml_config="$1"
34shift
35
36port="$1"
37shift
38
39set -x
40$DOCKER_BINARY run $DOCKER_OPTS -it \
41 -p $port:$port \
42 -v "$yaml_config:/app/config.yaml" \
43 $docker_image \
44 python -m llama_stack.distribution.server.server \
45 --yaml_config /app/config.yaml \
46 --port $port "$@"