-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.sh
More file actions
executable file
·44 lines (37 loc) · 1.27 KB
/
config.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Runtime Configuration - Edit settings here
# This file is sourced by all scripts
#
# To switch models:
# 1. Download: ./download-model.sh <model-id>
# 2. Change ACTIVE_MODEL below
# 3. Restart server/chat
# Active model (must match MODEL_ID in models.conf)
ACTIVE_MODEL="qwen2.5-coder-7b"
# Model parameters
N_THREADS=6 # Leave 1 thread for system
CONTEXT_SIZE=4096 # Context window size
TEMPERATURE=0.5 # Lower = more focused, higher = more creative
TOP_P=0.95 # Nucleus sampling
REPEAT_PENALTY=1.1 # Penalize repetition
# Server settings
SERVER_HOST="127.0.0.1"
SERVER_PORT=8080
# Paths (relative to script location)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODELS_DIR="${SCRIPT_DIR}/models"
LLAMA_CPP_DIR="${SCRIPT_DIR}/llama.cpp"
# Get model filename from models.conf
get_model_file() {
local model_id="$1"
grep "^${model_id}|" "${SCRIPT_DIR}/models.conf" | cut -d'|' -f3
}
# Get chat template from models.conf
get_chat_template() {
local model_id="$1"
grep "^${model_id}|" "${SCRIPT_DIR}/models.conf" | cut -d'|' -f6
}
# Get full model path and template
MODEL_FILE=$(get_model_file "$ACTIVE_MODEL")
MODEL_PATH="${MODELS_DIR}/${MODEL_FILE}"
CHAT_TEMPLATE=$(get_chat_template "$ACTIVE_MODEL")