Record token usage per turn and show daily, weekly and all-time totals by host
This commit is contained in:
+5
-1
@@ -198,8 +198,12 @@ if [[ "$SEARCH_ONLY" == true ]]; then
|
||||
"--k=${AI_SEARCH_K:-8}" "--per-file=${AI_SEARCH_PER_FILE:-3}"
|
||||
else
|
||||
[[ -z "$GEN_MODEL" ]] && { error "${MY_ID}_OLLAMA_MODEL is empty — needed for generation"; exit 1; }
|
||||
# Token accounting. Passed in rather than re-read in node, so the conf stays the shell's job
|
||||
# and cli.js keeps taking everything it needs as arguments. Omitting either flag simply
|
||||
# skips the row — the CLI must still work when called by hand outside this wrapper.
|
||||
node --no-warnings "$CLI" ask "${_args[@]}" \
|
||||
"--model=${GEN_MODEL}" "--embed-model=${EMBED_MODEL}" \
|
||||
"--k=${AI_SEARCH_K:-8}" "--per-file=${AI_SEARCH_PER_FILE:-3}" \
|
||||
"--timeout=$(( ${AI_REQUEST_TIMEOUT:-240} * 1000 ))"
|
||||
"--timeout=$(( ${AI_REQUEST_TIMEOUT:-240} * 1000 ))" \
|
||||
"--token-db=${AI_TOKEN_DB:-}" "--token-host=$(echo "$MY_ID" | tr '[:upper:]' '[:lower:]')"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user