0xarchit commited on
Commit
1420bd1
·
1 Parent(s): 392efee

Fix llama-server startup and enable LangSearch via shell tool

Browse files
Files changed (2) hide show
  1. README.md +4 -2
  2. start.sh +5 -1
README.md CHANGED
@@ -79,7 +79,9 @@ Expected: 3-5 t/s generation speed (vs 2-3 t/s with default settings).
79
 
80
  ## Web Search Tool (Standalone)
81
 
82
- The search tool is **not callable via model tool calling** (llama.cpp's `--tools` only supports built-in file/shell operations).
 
 
83
 
84
  **Use cases:**
85
  - Call from your application layer to augment model responses
@@ -105,7 +107,7 @@ response = requests.post(
105
  latest_response = response.json()['choices'][0]['message']['content']
106
  ```
107
 
108
- Then separately call search tool from your backend:
109
 
110
  ```bash
111
  python3 /app/search_tool.py "latest AI news" 5 true noLimit
 
79
 
80
  ## Web Search Tool (Standalone)
81
 
82
+ When `LANGSEARCH_API_KEY` is set, `start.sh` enables llama.cpp's shell tool so the model can launch the local LangSearch wrapper.
83
+
84
+ llama.cpp does not expose arbitrary external HTTP APIs as first-class built-in tools, so LangSearch is still implemented as a local wrapper that runs through the shell tool.
85
 
86
  **Use cases:**
87
  - Call from your application layer to augment model responses
 
107
  latest_response = response.json()['choices'][0]['message']['content']
108
  ```
109
 
110
+ Then call the search tool from your backend or from the shell tool:
111
 
112
  ```bash
113
  python3 /app/search_tool.py "latest AI news" 5 true noLimit
start.sh CHANGED
@@ -18,6 +18,7 @@ export CACHE_TYPE_V="${CACHE_TYPE_V:-f16}"
18
  export REASONING="${REASONING:-auto}"
19
  export TOOLS="${TOOLS:-}"
20
  export NO_WARMUP="${NO_WARMUP:-0}"
 
21
 
22
  # Ensure data directories exist and are writable. Run as root in container startup.
23
  echo "preparing storage: $HF_HOME and $MODEL_DIR"
@@ -116,7 +117,6 @@ server_args=(
116
  --cache-type-k "${CACHE_TYPE_K}"
117
  --cache-type-v "${CACHE_TYPE_V}"
118
  --metrics
119
- --continuous-batching
120
  )
121
 
122
  if [ "${NO_WARMUP}" = "1" ]; then
@@ -139,6 +139,10 @@ case "${REASONING,,}" in
139
  ;;
140
  esac
141
 
 
 
 
 
142
  if [[ -n "${TOOLS}" ]]; then
143
  server_args+=(--tools "$TOOLS")
144
  echo "enabled tools: $TOOLS"
 
18
  export REASONING="${REASONING:-auto}"
19
  export TOOLS="${TOOLS:-}"
20
  export NO_WARMUP="${NO_WARMUP:-0}"
21
+ export LANGSEARCH_API_KEY="${LANGSEARCH_API_KEY:-}"
22
 
23
  # Ensure data directories exist and are writable. Run as root in container startup.
24
  echo "preparing storage: $HF_HOME and $MODEL_DIR"
 
117
  --cache-type-k "${CACHE_TYPE_K}"
118
  --cache-type-v "${CACHE_TYPE_V}"
119
  --metrics
 
120
  )
121
 
122
  if [ "${NO_WARMUP}" = "1" ]; then
 
139
  ;;
140
  esac
141
 
142
+ if [ -n "$LANGSEARCH_API_KEY" ] && [ -z "$TOOLS" ]; then
143
+ TOOLS="exec_shell_command"
144
+ fi
145
+
146
  if [[ -n "${TOOLS}" ]]; then
147
  server_args+=(--tools "$TOOLS")
148
  echo "enabled tools: $TOOLS"