-
Notifications
You must be signed in to change notification settings - Fork 14
add Llama Stack quickstart guide and notebook demo #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
davidwtf
wants to merge
2
commits into
main
Choose a base branch
from
feat/llama_stack_quick_start
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+588
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
docs/en/solutions/How_to_Create_an_AI_Agent_with_LlamaStack.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- | ||
| products: | ||
| - Alauda AI | ||
| kind: | ||
| - Solution | ||
| ProductsVersion: | ||
| - 4.x | ||
| --- | ||
|
|
||
| # How To Create AI Agent with Llama Stack | ||
|
|
||
| ## Overview | ||
|
|
||
| Llama Stack is a framework for building and running AI agents with tools. It provides a server-based architecture that enables developers to create agents that can interact with users, access external tools, and perform complex reasoning tasks. This guide provides a quickstart example for creating an AI Agent using Llama Stack. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Llama Stack Server installed and running (see notebook for installation and startup instructions) | ||
| - For deploying Llama Stack Server on Kubernetes, refer to the [Kubernetes Deployment Guide](https://llamastack.github.io/docs/deploying/kubernetes_deployment) | ||
| - Access to a Notebook environment (e.g., Jupyter Notebook, JupyterLab, or similar) | ||
| - Python environment with `llama-stack-client` and required dependencies installed | ||
| - API key for the LLM provider (e.g., DeepSeek API key) | ||
|
|
||
| ## Quickstart | ||
|
|
||
| A simple example of creating an AI Agent with Llama Stack is available here: [llama_stack_quickstart.ipynb](/llama-stack/llama_stack_quickstart.ipynb). The configuration file [llama_stack_config.yaml](/llama-stack/llama_stack_config.yaml) is also required. Download both files and upload them to a Notebook environment to run. | ||
|
|
||
| The notebook demonstrates: | ||
| - Llama Stack Server installation and configuration | ||
| - Server startup and connection setup | ||
| - Tool definition using the `@client_tool` decorator (weather query tool example) | ||
| - Client connection to Llama Stack Server | ||
| - Model selection and Agent creation with tools and instructions | ||
| - Agent execution with session management and streaming responses | ||
| - Result handling and display | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| For more resources on developing AI Agents with Llama Stack, see: | ||
|
|
||
| - [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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| version: "2" | ||
| image_name: llama-stack-demo | ||
| apis: | ||
| - inference | ||
| - agents | ||
| - safety | ||
| - tool_runtime | ||
| - vector_io | ||
| - files | ||
|
|
||
| providers: | ||
| inference: | ||
| - provider_id: openai | ||
| provider_type: remote::openai | ||
| config: | ||
| api_key: ${env.API_KEY} | ||
| base_url: https://api.deepseek.com/v1 | ||
| agents: | ||
| - provider_id: meta-reference | ||
| provider_type: inline::meta-reference | ||
| config: | ||
| persistence: | ||
| agent_state: | ||
| backend: kv_default | ||
| namespace: agents | ||
| responses: | ||
| backend: sql_default | ||
| table_name: responses | ||
| safety: | ||
| - provider_id: llama-guard | ||
| provider_type: inline::llama-guard | ||
| config: | ||
| excluded_categories: [] | ||
| tool_runtime: [] | ||
| vector_io: | ||
| - provider_id: sqlite-vec | ||
| provider_type: inline::sqlite-vec | ||
| config: | ||
| db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/llama-stack-demo}/sqlite_vec.db | ||
| persistence: | ||
| backend: kv_default | ||
| namespace: vector_io::sqlite_vec | ||
| files: | ||
| - provider_id: localfs | ||
| provider_type: inline::localfs | ||
| config: | ||
| storage_dir: ${env.SQLITE_STORE_DIR:~/.llama/distributions/llama-stack-demo}/files | ||
| metadata_store: | ||
| backend: sql_default | ||
| table_name: files_metadata | ||
|
|
||
| metadata_store: | ||
| type: sqlite | ||
|
|
||
| models: | ||
| - metadata: {} | ||
| model_id: deepseek/deepseek-chat | ||
| provider_id: openai | ||
| provider_model_id: deepseek-chat | ||
| model_type: llm | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.