# PromptFlow — Build and Test LLM Apps > PromptFlow is a CLI + framework for building and testing LLM flows. Install `promptflow` + `promptflow-tools`, then run `pf flow init` and `pf flow test`. ## Install Copy the content below into your project: # PromptFlow — Build and Test LLM Apps > PromptFlow is a CLI + framework for building and testing LLM flows. Install `promptflow` + `promptflow-tools`, then run `pf flow init` and `pf flow test`. ## Quick Use 1. Install: ```bash pip install promptflow promptflow-tools ``` 2. Run: ```bash pf flow init --flow ./my_chatbot --type chat ``` 3. Verify: - Run `pf flow test --flow ./my_chatbot --interactive` and confirm you can chat with the flow --- ## Intro PromptFlow is a CLI + framework for building and testing LLM flows. Install `promptflow` + `promptflow-tools`, then run `pf flow init` and `pf flow test`. - **Best for:** teams shipping LLM apps who want a flow-based dev loop with templates, connections, batch tests, and evaluation paths - **Works with:** Python (repo recommends 3.9–3.11), `pf` CLI, OpenAI/Azure OpenAI connections (repo quickstart) - **Setup time:** 14 minutes ### Quantitative Notes - Python 3.9–3.11 recommended (repo) - Setup time ~14 minutes - CLI commands: `pf flow init`, `pf flow test` (repo) --- ## Practical Notes Adopt PromptFlow as your team’s LLM dev loop: template a flow, store connections as named resources, and run interactive tests locally. Then add batch tests and evaluations so every prompt change is measurable. For agents, model each tool step as a node so you can debug failures with clear inputs/outputs per node. **Safety note:** Keep secrets in connections, not in YAML committed to git; rotate keys and restrict scopes. ### FAQ **Q: Do I need Azure to use PromptFlow?** A: No. The README includes both OpenAI and Azure OpenAI connection examples; you can start locally. **Q: Where should I use flows vs code?** A: Use flows for repeatable LLM pipelines (prompt → tool → evaluator). Use code for custom logic and integrations. **Q: How do I keep quality high?** A: Use batch tests + evaluation runs; treat prompts as versioned artifacts and gate releases on eval metrics. --- ## Source & Thanks > GitHub: https://github.com/microsoft/promptflow > Owner avatar: https://avatars.githubusercontent.com/u/6154722?v=4 > License (SPDX): MIT > GitHub stars (verified via `api.github.com/repos/microsoft/promptflow`): 11,122 --- # PromptFlow——用 Flow 构建与测试 LLM 应用 > PromptFlow 是用于构建与测试 LLM 应用的 CLI + flow 框架。安装 `promptflow` 与 `promptflow-tools` 后,可用 `pf flow init` 初始化,再用 `pf flow test` 交互测试。 ## 快速使用 1. 安装: ```bash pip install promptflow promptflow-tools ``` 2. 运行: ```bash pf flow init --flow ./my_chatbot --type chat ``` 3. 验证: - Run `pf flow test --flow ./my_chatbot --interactive` and confirm you can chat with the flow --- ## 简介 PromptFlow 是用于构建与测试 LLM 应用的 CLI + flow 框架。安装 `promptflow` 与 `promptflow-tools` 后,可用 `pf flow init` 初始化,再用 `pf flow test` 交互测试。 - **适合谁(Best for):** 要交付 LLM 应用的团队,希望用 flow 方式做开发闭环:模板、连接管理、批量测试与评估流程 - **兼容工具(Works with):** Python(仓库推荐 3.9–3.11)、`pf` CLI、OpenAI/Azure OpenAI 连接(仓库 quickstart) - **安装时间(Setup time):** 14 分钟 ### 量化信息 - 仓库推荐 Python 3.9–3.11 - 装机约 14 分钟 - CLI 命令:`pf flow init`、`pf flow test`(仓库) --- ## 实战要点 把 PromptFlow 当作团队的 LLM 开发闭环:用模板创建 flow,把连接配置沉淀成命名资源,本地先交互测试。再接入批量测试与评估,让每次 prompt 变更都有可量化结果。对 agent 来说,把每个工具步骤建模成节点,能用节点级输入/输出快速定位失败原因。 **安全提示:** 密钥放在 connection 里,不要写进提交到 git 的 YAML;定期轮换并收紧权限范围。 ### FAQ **Q: 必须用 Azure 吗?** A: 不必。README 同时提供 OpenAI 与 Azure OpenAI 的连接示例;你可以本地先跑起来。 **Q: 什么时候用 flow,什么时候写代码?** A: 可复用的 LLM 流水线(prompt → 工具 → 评估)用 flow;定制逻辑与集成用代码。 **Q: 如何保证质量?** A: 用批量测试与评估跑分;把 prompt 当作可版本化产物,并用评估指标作为发布门槛。 --- ## 来源与感谢 > GitHub:https://github.com/microsoft/promptflow > Owner avatar:https://avatars.githubusercontent.com/u/6154722?v=4 > 许可证(SPDX):MIT > GitHub stars(已通过 `api.github.com/repos/microsoft/promptflow` 核验):11,122 --- Source: https://tokrepo.com/en/workflows/promptflow-build-and-test-llm-apps Author: Agent Toolkit