char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Evan HuusPrefer npm ci over install for security (#26601)6ea215d17

char/aliceai-t5-moe
1.6 KiB61 linesraw
1#!/bin/bash
2
3# Development script for llama-ui
4#
5# This script starts the llama-ui development servers (Storybook and Vite).
6# Note: You need to start llama-server separately.
7#
8# Usage:
9#   bash scripts/dev.sh
10#   npm run dev
11
12cd ../../
13
14# Ensure node_modules are installed
15if [ ! -d "tools/ui/node_modules" ]; then
16    echo "๐Ÿ“ฆ Installing npm dependencies..."
17    cd tools/ui && npm ci && cd ../../
18fi
19
20# Check and install git hooks if missing
21check_and_install_hooks() {
22    local hooks_missing=false
23
24    # Check for required hooks
25    if [ ! -f ".git/hooks/pre-commit" ] || [ ! -f ".git/hooks/pre-push" ]; then
26        hooks_missing=true
27    fi
28
29    if [ "$hooks_missing" = true ]; then
30        echo "๐Ÿ”ง Git hooks missing, installing them..."
31        if bash "$(dirname "$0")/git-hooks/install.sh"; then
32            echo "โœ… Git hooks installed successfully"
33        else
34            echo "โš ๏ธ  Failed to install git hooks, continuing anyway..."
35        fi
36    else
37        echo "โœ… Git hooks already installed"
38    fi
39}
40
41# Install git hooks if needed
42check_and_install_hooks
43
44# Cleanup function
45cleanup() {
46    echo "๐Ÿงน Cleaning up..."
47    exit
48}
49
50# Set up signal handlers
51trap cleanup SIGINT SIGTERM
52
53echo "๐Ÿš€ Starting development servers..."
54echo "๐Ÿ“ Note: Make sure to start llama-server separately if needed"
55cd tools/ui
56# Use --insecure-http-parser to handle malformed HTTP responses from llama-server
57# (some responses have both Content-Length and Transfer-Encoding headers)
58storybook dev -p 6006 --ci & NODE_OPTIONS="--insecure-http-parser" vite dev --host 0.0.0.0 &
59
60# Wait for all background processes
61wait