Add apply_discovery.sh convenience wrapper
This commit is contained in:
parent
0ab8675290
commit
2019ca75f3
1 changed files with 22 additions and 0 deletions
22
apply_discovery.sh
Normal file
22
apply_discovery.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
# Convenience wrapper: run discovery and restart opencode
|
||||
# Place on TrueNAS and run via cron or manually
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
CONFIG_PATH="${OPENCODE_CONFIG:-$HOME/.config/opencode/opencode.log}"
|
||||
API_KEY="${NINEROUTER_API_KEY:-}"
|
||||
BASE_URL="${NINEROUTER_BASE_URL:-https://ollama.wilddragon.net/v1}"
|
||||
|
||||
if [ -z "$API_KEY" ]; then
|
||||
echo "ERROR: Set NINEROUTER_API_KEY" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== 9Router Model Discovery ===" >&2
|
||||
python3 "$SCRIPT_DIR/discover_models.py" \
|
||||
--config "$CONFIG_PATH" \
|
||||
--api-key "$API_KEY" \
|
||||
--base-url "$BASE_URL" \
|
||||
"$@"
|
||||
echo "=== Done ===" >&2
|
||||
Loading…
Reference in a new issue