From e6b3361faab615c3e8543225f827d305ea839010 Mon Sep 17 00:00:00 2001 From: rudi193-cmd Date: Thu, 21 May 2026 12:01:53 -0600 Subject: [PATCH] docs(cookbook): add optional langfuse prerequisites Completes Greptile review follow-up: document langfuse install/env vars as optional in prerequisites, clarify cost cell uses completion_cost(). Co-authored-by: Cursor --- cookbook/LiteLLM_Custom_FineTuned_GGUF_Ollama.ipynb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cookbook/LiteLLM_Custom_FineTuned_GGUF_Ollama.ipynb b/cookbook/LiteLLM_Custom_FineTuned_GGUF_Ollama.ipynb index d12d8558956..704b4d9a901 100644 --- a/cookbook/LiteLLM_Custom_FineTuned_GGUF_Ollama.ipynb +++ b/cookbook/LiteLLM_Custom_FineTuned_GGUF_Ollama.ipynb @@ -16,6 +16,14 @@ "pip install litellm ollama\n", "```\n", "\n", + "**Optional** — only if you enable the Langfuse callback in the cost-tracking section below:\n", + "\n", + "```bash\n", + "pip install langfuse\n", + "export LANGFUSE_PUBLIC_KEY=\"your-public-key\"\n", + "export LANGFUSE_SECRET_KEY=\"your-secret-key\"\n", + "```\n", + "\n", "Deploy your GGUF model with Ollama:\n", "```bash\n", "# Pull directly from Hugging Face Hub (no Modelfile needed for basic use)\n", @@ -131,7 +139,7 @@ "source": [ "## Cost tracking for your local model\n", "\n", - "LiteLLM can track usage for local models too — useful when comparing cost efficiency of your fine-tuned model vs cloud." + "LiteLLM can track usage for local models too — useful when comparing cost efficiency of your fine-tuned model vs cloud. Uses the public `completion_cost()` API (same as `LiteLLM_Completion_Cost.ipynb`). Langfuse logging is optional; see prerequisites." ] }, { @@ -140,7 +148,8 @@ "metadata": {}, "outputs": [], "source": [ - "# litellm.success_callback = [\"langfuse\"] # uncomment if you have langfuse installed/configured\n", + "# Optional: send completions to Langfuse (requires pip install langfuse + env vars above)\n", + "# litellm.success_callback = [\"langfuse\"]\n", "\n", "# Set a custom cost for your local model ($/1M tokens)\n", "litellm.register_model({\n",