{"id":14539437,"url":"https://github.com/meta-llama/llama-stack-apps","last_synced_at":"2025-05-13T19:03:46.830Z","repository":{"id":249841687,"uuid":"820144632","full_name":"meta-llama/llama-stack-apps","owner":"meta-llama","description":"Agentic components of the Llama Stack APIs","archived":false,"fork":false,"pushed_at":"2025-04-30T18:01:33.000Z","size":103737,"stargazers_count":4229,"open_issues_count":25,"forks_count":621,"subscribers_count":79,"default_branch":"main","last_synced_at":"2025-05-12T16:12:49.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meta-llama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-25T22:29:07.000Z","updated_at":"2025-05-11T17:22:54.000Z","dependencies_parsed_at":"2025-04-25T16:07:14.348Z","dependency_job_id":null,"html_url":"https://github.com/meta-llama/llama-stack-apps","commit_stats":{"total_commits":102,"total_committers":21,"mean_commits":4.857142857142857,"dds":0.7254901960784313,"last_synced_commit":"9d915bd1b0adf8dbe807aee4f341e0980c46a088"},"previous_names":["meta-llama/llama-agentic-system"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-llama%2Fllama-stack-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-llama%2Fllama-stack-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-llama%2Fllama-stack-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-llama%2Fllama-stack-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meta-llama","download_url":"https://codeload.github.com/meta-llama/llama-stack-apps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253900616,"owners_count":21981273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-05T15:01:08.593Z","updated_at":"2025-05-13T19:03:46.813Z","avatar_url":"https://github.com/meta-llama.png","language":null,"funding_links":[],"categories":["Others","Python","A01_文本生成_文本对话","miscellaneous","LLM Application / RAG","Table of Open-Source AI Agents Projects"],"sub_categories":["大语言对话模型及数据"],"readme":"# llama-stack-apps\n\n[![Discord](https://img.shields.io/discord/1257833999603335178)](https://discord.gg/llama-stack)\n\nThis repo shows examples of applications built on top of [Llama Stack](https://github.com/meta-llama/llama-stack). Starting Llama 3.1 you can build agentic applications capable of:\n\n- breaking a task down and performing multi-step reasoning.\n- using tools to perform some actions\n  - built-in: the model has built-in knowledge of tools like search or code interpreter\n  - zero-shot: the model can learn to call tools using previously unseen, in-context tool definitions\n- providing system level safety protections using models like Llama Guard.\n\n\n\nAn agentic app requires a few components:\n- ability to run inference on the underlying Llama series of models\n- ability to run safety checks using the Llama Guard series of models\n- ability to execute tools, including a code execution environment, and loop using the model's multi-step reasoning process\n\nAll of these components are now offered by a single Llama Stack Distribution. The [Llama Stack](https://github.com/meta-llama/llama-stack) defines and standardizes these components and many others that are needed to make building Generative AI applications smoother. Various implementations of these APIs are then assembled together via a **Llama Stack Distribution**.\n\n## Getting started with the Llama Stack Apps\n\nTo get started with Llama Stack Apps, you'll need to:\n\n1. Install prerequisites\n3. Start a Llama Stack server\n4. Connect your client agentic app to Llama Stack server\n\nOnce started, you can then just point your agentic app to the URL for this server (e.g. `http://localhost:8321`).\n\n### 1. Install Prerequisites\n\n**Python Packages**\n\nWe recommend creating an isolated conda Python environment.\n\n```bash\n# Create and activate a virtual environment\nENV=stack\nconda create -n $ENV python=3.10\ncd \u003cpath-to-llama-stack-apps-repo\u003e\nconda activate $ENV\n\n# Install dependencies\npip install -r requirements.txt\n```\n\nThis will install all dependencies required to (1) Build and start a Llama Stack server (2) Connect your client app to Llama Stack server.\n\n\n### 2. Starting a Llama Stack Server\n- Please see our [llama-stack](https://github.com/meta-llama/llama-stack) repo's [Getting Started Guide](https://llama-stack.readthedocs.io/en/latest/getting_started/index.html) for setting up a Llama Stack distribution and running server to serve API endpoints. You should have a server endpoint for building your client apps.\n\nOnce your server is started, you should have seen outputs --\n```\n...\nListening on :::8321\nINFO:     Started server process [587053]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\nINFO:     Uvicorn running on http://[::]:8321 (Press CTRL+C to quit)\n```\n\n### 3. Test agents demo script\n\nWe have built sample demo scripts for interacting with the Stack server.\n\nWith the server running, you may run to test out an simple Agent\n\nThis example will require the API key from Tavily Search. You need to set it to the environment variable `TAVILY_SEARCH_API_KEY`\n\nLinux/Mac\n```\nexport TAVILY_SEARCH_API_KEY=[KEY]\n```\nTo run:\n```\npython -m examples.agents.hello localhost 8321\n```\n\nYou will see outputs of the form --\n```\n\u003e created agents with agent_id=d050201b-0ca1-4abd-8eee-3cba2b8c0fbc\nUser\u003e Hello\nshield_call\u003e No Violation\ninference\u003e How can I assist you today?\nshield_call\u003e No Violation\nUser\u003e Which players played in the winning team of the NBA western conference semifinals of 2024, please use tools\nshield_call\u003e No Violation\ninference\u003e brave_search.call(query=\"NBA Western Conference Semifinals 2024 winning team players\")\ntool_execution\u003e Tool:brave_search Args:{'query': 'NBA Western Conference Semifinals 2024 winning team players'}\ntool_execution\u003e Tool:brave_search Response:{\"query\": \"NBA Western Conference Semifinals 2024 winning team players\", \"top_k\": [{\"title\": \"2024 NBA Western Conference Semifinals - Mavericks vs. Thunder | Basketball-Reference.com\", \"url\": \"https://www.basketball-reference.com/playoffs/2024-nba-western-conference-semifinals-mavericks-vs-thunder.html\", \"description\": \"Summary and statistics for the \u003cstrong\u003e2024\u003c/strong\u003e \u003cstrong\u003eNBA\u003c/strong\u003e \u003cstrong\u003eWestern\u003c/strong\u003e \u003cstrong\u003eConference\u003c/strong\u003e \u003cstrong\u003eSemifinals\u003c/strong\u003e - Mavericks vs. Thunder\", \"type\": \"search_result\"}, {\"title\": \"2024 NBA playoffs - Wikipedia\", \"url\": \"https://en.wikipedia.org/wiki/2024_NBA_playoffs\", \"description\": \"Aged 20 years and 96 days old, ... youngest \u003cstrong\u003eplayer\u003c/strong\u003e \u003cstrong\u003ein\u003c/strong\u003e \u003cstrong\u003eNBA\u003c/strong\u003e history to record 10+ points and 15+ rebounds in a playoff game, coming during game 6 of the Maverick\u0026#x27;s \u003cstrong\u003eWestern\u003c/strong\u003e \u003cstrong\u003eConference\u003c/strong\u003e \u003cstrong\u003eSemifinal\u003c/strong\u003e \u003cstrong\u003ewin\u003c/strong\u003e against the Thunder on May 18. The Timberwolves overcame a 20\\u2013point deficit to \u003cstrong\u003ewin\u003c/strong\u003e game 7 against the Nuggets, the largest game 7 comeback in \u003cstrong\u003eNBA\u003c/strong\u003e playoffs history. With the defending champion Nuggets losing to the Minnesota Timberwolves, the \u003cstrong\u003e2024\u003c/strong\u003e playoffs marked ...\", \"type\": \"search_result\"}, {\"title\": \"2024 NBA Playoffs | Official Bracket, Schedule and Series Matchups\", \"url\": \"https://www.nba.com/playoffs/2024\", \"description\": \"The official site of the \u003cstrong\u003e2024\u003c/strong\u003e \u003cstrong\u003eNBA\u003c/strong\u003e Playoffs. Latest news, schedules, matchups, highlights, bracket and more.\", \"type\": \"search_result\"}]}\nshield_call\u003e No Violation\ninference\u003e The players who played in the winning team of the NBA Western Conference Semifinals of 2024 are not specified in the search results provided. However, the search results suggest that the Mavericks played against the Thunder in the Western Conference Semifinals, and the Mavericks won the series.\nshield_call\u003e No Violation\n```\n\n## Start an App and Interact with the Server\n\nNow that the Stack server is setup, the next thing would be to run an agentic app using Agents APIs.\n\nWe have built sample scripts, notebooks and a UI chat interface ( using [Gradio]([url](https://www.gradio.app/)) ! ) to help you get started.\n\nStart an app (local) and interact with it by running the following command:\n```bash\nPYTHONPATH=. python examples/agent_store/app.py localhost 8321\n```\n\n\u003cimg src=\"demo.png\" alt=\"Chat App\" width=\"600\"/\u003e\n\nOptionally, you can setup API keys for custom tools:\n- [WolframAlpha](https://developer.wolframalpha.com/): store in `WOLFRAM_ALPHA_API_KEY` environment variable\n- [Brave Search](https://brave.com/search/api/): store in `BRAVE_SEARCH_API_KEY` environment variable\n\nYou may see other ways of interacting in [Agent Store README.md](https://github.com/meta-llama/llama-stack-apps/tree/main/examples/agent_store)\n\n## Create agentic systems and interact with the Stack server\n\nNOTE: Ensure that Stack server is still running.\n\n```bash\ncd \u003cpath-to-llama-stack-apps-repo\u003e\nconda activate $ENV\nllama stack run \u003cname\u003e # If not already started\n\npython -m examples.agents.rag_with_vector_db localhost 8321\n```\n\nYou should see outputs to stdout of the form --\n```bash\nAvailable shields found: ['meta-llama/Llama-Guard-3-8B']\nUsing model: meta-llama/Llama-3.1-405B-Instruct\nCreated session_id=cdb8a978-0085-4f3d-a976-939ba2b19de9 for Agent(0cfe05a8-cb97-430f-bec6-b1c7d42c712a)\nshield_call\u003e No Violation\nmemory_retrieval\u003e Retrieved context from vector dbs: ['test_vector_db'].\n====\nHere are the retrieved documents for relevant context:\n=== START-RETRIEVED-CONTEXT ===\n id:num-1; content:_\nthe template from Llama2 to better support multiturn conversations. The same text\nin the Lla...\n\u003e\ninference\u003e Based on the provided documentation, here are the top 5 topics explained:\n\n* Fine-tuning Llama3 with chat data\n* Template changes from Llama2 to Llama3\n* Tokenizing prompt templates and special tokens\n* Fine-tuning on a custom chat dataset\n* Using prompt templates for specific tasks\nshield_call\u003e No Violation\n\n...\n```\n\n\nFeel free to reach out if you have questions.\n\n\n## The Llama Stack Client SDK\n- Check out our client SDKs for connecting to Llama Stack server, you can choose from [python](https://github.com/meta-llama/llama-stack-client-python), [node](https://github.com/meta-llama/llama-stack-client-node), [swift](https://github.com/meta-llama/llama-stack-client-swift), and [kotlin](https://github.com/meta-llama/llama-stack-client-kotlin) programming languages to quickly build your applications.\n\n\n## Using VirtualEnv instead of Conda\n\n\u003e [!NOTE]\n\u003e While you can run the apps using `venv`, installation of a distribution requires conda.\n\n#### In Linux\n\n```bash\n# Create and activate a virtual environment\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n#### For Windows\n\n```bash\n# Create and activate a virtual environment\npython -m venv venv\nvenv\\Scripts\\activate  # For Command Prompt\n# or\n.\\venv\\Scripts\\Activate.ps1  # For PowerShell\n# or\nsource venv/Scripts/activate  # For Git Bash\n```\n\nThe instructions thereafter (including `pip install -r requirements.txt` for installing the dependencies) remain the same.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-llama%2Fllama-stack-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeta-llama%2Fllama-stack-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-llama%2Fllama-stack-apps/lists"}