Skip to content

add llama-stack introduciton and simple usage#111

Merged
davidwtf merged 4 commits intomasterfrom
add-llama-stack
Feb 26, 2026
Merged

add llama-stack introduciton and simple usage#111
davidwtf merged 4 commits intomasterfrom
add-llama-stack

Conversation

@davidwtf
Copy link
Copy Markdown
Contributor

@davidwtf davidwtf commented Feb 26, 2026

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Llama Stack docs (overview, intro, features, index).
    • Added Kubernetes installation and deployment guide for Llama Stack Server.
    • Added quickstart with agent/tool examples, FAQ, and notebook-ready instructions.
    • Added multiple Jupyter notebooks demonstrating agent workflows, client-side tools, MCP tool integration, and FastAPI deployment examples.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 26, 2026

Walkthrough

Adds a new Llama Stack documentation section and example notebooks: landing, install, overview (intro/features), quickstart, and two public Jupyter notebooks demonstrating client-side and MCP-based agent tools and deployment examples.

Changes

Cohort / File(s) Summary
Top-level docs
docs/en/llama_stack/index.mdx, docs/en/llama_stack/overview/index.mdx
New landing and overview pages with frontmatter and an Overview component placeholder.
Overview & Features
docs/en/llama_stack/overview/intro.mdx, docs/en/llama_stack/overview/features.mdx
New pages describing architecture, components (server, client, agents, tools), configuration, deployment/distribution options, and integration notes.
Installation
docs/en/llama_stack/install.mdx
New install/deploy guide for Llama Stack Server via the Llama Stack Operator, including operator upload, install steps, LlamaStackDistribution CR YAML, prerequisites, and post-deployment status example.
Quickstart & Client notebook
docs/en/llama_stack/quickstart.mdx, docs/public/llama-stack/llama-stack_quickstart.ipynb
Quickstart guide and notebook demonstrating agent creation, @client_tool weather example, session streaming, FastAPI example, and notebook kernel/setup instructions.
MCP notebook
docs/public/llama-stack/llama-stack_quickstart_mcp.ipynb
Notebook demonstrating an MCP-based weather tool/server, MCP transport registration, client registration of MCP tools, workflow, troubleshooting, and cleanup cells.

Sequence Diagram(s)

(omitted — changes are documentation and example notebooks; no runtime control-flow changes requiring diagrams)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • zhaomingkun1030
  • typhoonzero

Poem

🐰 I hopped through docs and notebooks bright,
Wrote tools and guides beneath the light,
Weather, MCP, agents in play,
Tiny hops that show the way,
Enjoy the stack — I danced all night!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add llama-stack introduciton and simple usage' accurately describes the main changes: it adds documentation and quickstart guides for Llama Stack introduction and usage examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-llama-stack

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 26, 2026

Deploying alauda-ai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3f8db45
Status: ✅  Deploy successful!
Preview URL: https://3089a048.alauda-ai.pages.dev
Branch Preview URL: https://add-llama-stack.alauda-ai.pages.dev

View logs

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/public/llama-stack/llama-stack_quickstart_mcp.ipynb (1)

58-59: Avoid exposing raw exception text in tool output.

Returning f"Error: {e}" can leak internal request/runtime details into model-visible output.

🛡️ Suggested error message hardening
-        except Exception as e:
-            return f"Error: {e}"
+        except Exception:
+            return "Error: failed to fetch weather data. Please try again later."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/public/llama-stack/llama-stack_quickstart_mcp.ipynb` around lines 58 -
59, The except block currently returns the raw exception string (except
Exception as e -> return f"Error: {e}"), which can leak internal details; change
it to return a fixed, user-safe error message (e.g., "An internal error
occurred") instead, and move the detailed exception information to internal
logs/monitoring by calling logger.exception(e) or similar inside the except
block so the full stack/exception is recorded but not exposed to model/tool
output. Ensure you update the except Exception as e handler that contains the
f"Error: {e}" return and add appropriate logging/monitoring calls while
returning only the generic message to callers.
docs/en/llama_stack/quickstart.mdx (1)

69-72: Consider rewording resource bullets to reduce repetitive starts.

Lines 69-72 repeatedly start with “Llama Stack …”. Minor polish, but easier to scan if varied.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/en/llama_stack/quickstart.mdx` around lines 69 - 72, The four bullets
starting with "Llama Stack ..." (the items "Llama Stack Documentation", "Llama
Stack Core Concepts", "Llama Stack GitHub Repository", and "Llama Stack Example
Apps") are repetitive—rewrite them to vary the lead phrase for easier scanning
(e.g., "Documentation:", "Core concepts:", "GitHub repo:", "Example apps:")
while preserving the links and the original descriptions; update the lines in
quickstart.mdx that contain those exact bullet texts to the new phrasing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/en/llama_stack/install.mdx`:
- Around line 13-17: The CLI example exposes a plaintext password via the
--platform-password flag (violet push), so change the example to avoid inline
credentials: remove the --platform-password=... usage and show a safer approach
such as prompting for the password, reading it from an environment variable
(e.g. PLATFORM_PASSWORD) or from a protected file/secret (e.g.
--platform-password-from-file), and update the example invocation and
explanatory text to demonstrate that pattern instead of embedding secrets in the
command line.

In `@docs/public/llama-stack/llama-stack_quickstart_mcp.ipynb`:
- Around line 42-49: The docstring for get_weather_mcp incorrectly states the
function returns a dictionary; update the :returns: section to reflect that
get_weather_mcp returns a formatted string (or an error string) instead of a
dict—e.g., change the return-type description to "str" and describe the string
contents (formatted weather summary or error message) so the docstring matches
the function's actual behavior.

---

Nitpick comments:
In `@docs/en/llama_stack/quickstart.mdx`:
- Around line 69-72: The four bullets starting with "Llama Stack ..." (the items
"Llama Stack Documentation", "Llama Stack Core Concepts", "Llama Stack GitHub
Repository", and "Llama Stack Example Apps") are repetitive—rewrite them to vary
the lead phrase for easier scanning (e.g., "Documentation:", "Core concepts:",
"GitHub repo:", "Example apps:") while preserving the links and the original
descriptions; update the lines in quickstart.mdx that contain those exact bullet
texts to the new phrasing.

In `@docs/public/llama-stack/llama-stack_quickstart_mcp.ipynb`:
- Around line 58-59: The except block currently returns the raw exception string
(except Exception as e -> return f"Error: {e}"), which can leak internal
details; change it to return a fixed, user-safe error message (e.g., "An
internal error occurred") instead, and move the detailed exception information
to internal logs/monitoring by calling logger.exception(e) or similar inside the
except block so the full stack/exception is recorded but not exposed to
model/tool output. Ensure you update the except Exception as e handler that
contains the f"Error: {e}" return and add appropriate logging/monitoring calls
while returning only the generic message to callers.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be6bbcc and d02cb6f.

📒 Files selected for processing (8)
  • docs/en/llama_stack/index.mdx
  • docs/en/llama_stack/install.mdx
  • docs/en/llama_stack/overview/features.mdx
  • docs/en/llama_stack/overview/index.mdx
  • docs/en/llama_stack/overview/intro.mdx
  • docs/en/llama_stack/quickstart.mdx
  • docs/public/llama-stack/llama-stack_quickstart.ipynb
  • docs/public/llama-stack/llama-stack_quickstart_mcp.ipynb

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/public/llama-stack/llama-stack_quickstart.ipynb`:
- Around line 87-94: The docstring for get_weather incorrectly states it returns
a formatted string; update the docstring to reflect the actual return type (a
Dict) and describe the dictionary keys and value types (e.g., {"city": str,
"temperature": str or float, "humidity": str or int, "error": Optional[str]} or
similar) so the :returns: section and description match the function signature
and implementation.
- Around line 324-329: The cell currently always starts a new
Thread(target=run_server, daemon=True) which can spawn duplicate servers on
re-runs; change it to first check if a running server_thread exists (e.g., if
'server_thread' in globals() and server_thread.is_alive()) and only create/start
the Thread when no alive server_thread is present, otherwise skip startup and
print that the server is already running; apply this guard around the Thread
creation/start and associated print so the cell becomes idempotent across
notebook re-runs.
- Around line 109-110: The except block that returns {'error': f'Failed to get
weather information: {str(e)}'} should not expose raw exception details; change
it to return a generic client-facing message (e.g., {'error': 'Failed to get
weather information'}) and log the full exception separately using a logger
(call logger.exception or logger.error with the exception) inside the same
except Exception as e: block so the variable e is recorded for debugging but not
returned to the caller.
- Around line 267-289: The chat endpoint currently calls
agent.create_session('fastapi-weather-session') on every request which creates a
new session each time; update the ChatRequest model to accept an optional
session_id, modify the chat(request: ChatRequest) handler to use
request.session_id if present, otherwise call agent.create_session() once to
create a new session_id, pass that session_id into agent.create_turn(...), and
include the (possibly newly created) session_id in the JSON response so clients
can reuse it for conversational continuity.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d02cb6f and b6cf36e.

📒 Files selected for processing (1)
  • docs/public/llama-stack/llama-stack_quickstart.ipynb

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
docs/en/llama_stack/quickstart.mdx (2)

42-42: Consider adding a note about the Python version currency.

The download URL is pinned to a specific version dated January 14, 2026. For better maintainability, consider adding a note indicating this is the current version as of the documentation date, and provide guidance on finding newer versions (e.g., linking to the releases page at https://github.com/astral-sh/python-build-standalone/releases).

📝 Suggested improvement
 1. Download the pre-compiled Python installation package:

+   **Note**: The following URL uses a specific version (January 14, 2026). For the latest version, visit the [Python Build Standalone releases page](https://github.com/astral-sh/python-build-standalone/releases).
+
    ```bash
    wget -O /tmp/python312.tar.gz https://github.com/astral-sh/python-build-standalone/releases/download/20260114/cpython-3.12.12+20260114-x86_64-unknown-linux-gnu-install_only.tar.gz
    ```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/en/llama_stack/quickstart.mdx` at line 42, Add a short note immediately
above or below the wget command that the URL is pinned to a specific Python
build (the cpython-3.12.12+20260114 URL) and that it was current as of the
documentation date, and include a link to the upstream releases page
(https://github.com/astral-sh/python-build-standalone/releases) with guidance to
check there for newer versions; update the text around the wget line to
explicitly recommend verifying the version before downloading and to replace the
URL with a newer release if available.

75-78: Consider varying the sentence structure for better readability.

All four bullet points begin with "Llama Stack," which creates a repetitive reading experience. Consider varying the sentence structure for improved flow.

✍️ Example variation
-- [Llama Stack Documentation](https://llamastack.github.io/docs) - The official Llama Stack documentation covering all usage-related topics, API providers, and core concepts.
-- [Llama Stack Core Concepts](https://llamastack.github.io/docs/concepts) - Deep dive into Llama Stack architecture, API stability, and resource management.
-- [Llama Stack GitHub Repository](https://github.com/llamastack/llama-stack) - Source code, example applications, distribution configurations, and how to add new API providers.
-- [Llama Stack Example Apps](https://github.com/llamastack/llama-stack-apps/) - Official examples demonstrating how to use Llama Stack in various scenarios.
+- [Official Documentation](https://llamastack.github.io/docs) - Comprehensive Llama Stack documentation covering all usage-related topics, API providers, and core concepts.
+- [Core Concepts Guide](https://llamastack.github.io/docs/concepts) - Deep dive into architecture, API stability, and resource management.
+- [GitHub Repository](https://github.com/llamastack/llama-stack) - Source code, example applications, distribution configurations, and how to add new API providers.
+- [Example Applications](https://github.com/llamastack/llama-stack-apps/) - Official examples demonstrating various usage scenarios.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/en/llama_stack/quickstart.mdx` around lines 75 - 78, The four list
entries ("Llama Stack Documentation", "Llama Stack Core Concepts", "Llama Stack
GitHub Repository", "Llama Stack Example Apps") are repetitive because each
starts with "Llama Stack"; reword each bullet to vary sentence openings and
improve flow by moving the subject or action first (e.g., "Official
documentation: ...", "Deep dive into core concepts: ...", "Source code and
examples on GitHub: ...", "Explore example applications: ..."), keeping the same
URLs and concise descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/en/llama_stack/quickstart.mdx`:
- Line 42: Add a short note immediately above or below the wget command that the
URL is pinned to a specific Python build (the cpython-3.12.12+20260114 URL) and
that it was current as of the documentation date, and include a link to the
upstream releases page
(https://github.com/astral-sh/python-build-standalone/releases) with guidance to
check there for newer versions; update the text around the wget line to
explicitly recommend verifying the version before downloading and to replace the
URL with a newer release if available.
- Around line 75-78: The four list entries ("Llama Stack Documentation", "Llama
Stack Core Concepts", "Llama Stack GitHub Repository", "Llama Stack Example
Apps") are repetitive because each starts with "Llama Stack"; reword each bullet
to vary sentence openings and improve flow by moving the subject or action first
(e.g., "Official documentation: ...", "Deep dive into core concepts: ...",
"Source code and examples on GitHub: ...", "Explore example applications: ..."),
keeping the same URLs and concise descriptions.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0ddb2b and 3f8db45.

📒 Files selected for processing (1)
  • docs/en/llama_stack/quickstart.mdx

@davidwtf davidwtf merged commit 74e610a into master Feb 26, 2026
3 checks passed
davidwtf added a commit that referenced this pull request Feb 26, 2026
* add llama-stack introduciton and simple usage

* update

* update

* update
@davidwtf davidwtf deleted the add-llama-stack branch February 26, 2026 14:31
@coderabbitai coderabbitai bot mentioned this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant