帳號與許可權
Q:如何使用企業身份系統(如 Okta)登入 LangStudio?
LangStudio 基於阿里雲 RAM 使用者體系,支援企業通過單點登入(SSO)方式接入。
如果企業已有身份管理系統(如 Okta、Microsoft Entra ID 等),可以通過配置阿里雲 RAM 使用者 SSO,實現員工使用企業帳號直接登入 LangStudio,無需單獨建立阿里雲帳號。
配置方法請參見企業使用自有身份系統單點登入雲。
完成 SSO 配置後,還需為 RAM 使用者授予 LangStudio 許可權,詳情請參見雲產品依賴與授權:LangStudio.
模型調用
Q:調用阿里雲百鍊模型報錯:OpenAI API hits APIConnectionError: Connection error
阿里雲百鍊模型需要通過公網訪問,在啟動運行時配置專用網路,同時專用網路需要開通公網訪問,詳情請參見使用公網NAT GatewaySNAT功能訪問互連網。
知識庫
Q:建立知識庫時如何選擇向量資料庫Faiss或Milvus?
Faiss通常用於測試環境,無需建立資料庫即可使用。在生產環境中,建議您使用Milvus資料庫,支援處理更大規模資料。
Q:知識庫使用Faiss資料庫報錯:The run failed due to reaching the timeout: 300
報錯原因:在使用Faiss向量資料庫時,向量資料庫儲存在OSS中,在運行時中載入使用,對機器效能要求較高。因此,建議運行時配置較大規模的資源,如8/16核CPU,確保系統能高效處理任務。
解決方案:
方法一:修改運行時配置。在運行時列表中單擊指定運行時名稱,然後單擊右上方变更配置,修改资源规格。
方法二:刪除已有運行時,重新建立資源規格更高的運行時,在應用流中引用。
Q:知識庫使用Faiss資料庫報錯:Tool load failed in 'index_lookup': (ToolLoadError) Failed to load package tool 'Index Lookup': (AccessDenied)
2025-04-18 17:27:29 +0800 117 execution.service INFO Received flow execution
request, flow id: flow-qlwey67df05uturaky, run id: run-if7o91uradb61ophen, request id:
unknown, executor version: promptflow-sdk/1.17.0+langstudio2503.0d03c82 promptflow-tracing/
1.17.0+langstudio2503.0d03c82.
2025-04-18 17:27:30 +0800 345 execution.flow INFO Start to execute flow flow
dag.yaml with run id run-if7o91uradb61ophen.
2025-04-18 17:27:31 +0800 117 execution.service ERROR Failed to execute flow, flow
id: flow-qlwey67df05uturaky, run id: run-if7o91uradb61ophen. Error: {"message": "Tool load
failed in 'index_lookup': (ToolLoadError) Failed to load package tool 'Index Lookup':
(AccessDenied) {'status': 403, 'x-oss-request-id': '68021B03E0E4E53535128F40', 'details':
{'Code': 'AccessDenied', 'Message': \"Access denied by authorizer's policy.\", 'RequestId':
'68021B03E0E4E53535128F40', 'HostId': 'xxx.oss-cn-hangzhou.aliyuncs.com',
'AccessDeniedDetail': '\\n ', 'EC': '0003-00000301', 'RecommendDoc': 'https://api.aliyun.
com/troubleshoot?q=0003-00000301'}}", "messageFormat": "Tool load failed in '{node_name}'.
", "messageParameters": {"node_name": "index_lookup"}, "referenceCode": "Tool/langstudio.
tools.index_lookup", "code": "UserError", "innerError": {"code": "ToolLoadError",
"innerError": null}, "debugInfo": {"type": "ResolveToolError", "message": "Tool load failed
in 'index_lookup': (ToolLoadError) Failed to load package tool 'Index Lookup'
(AccessDenied) {'status': 403, 'x-oss-request-id': '68021B03E0E4E53535128F40', 'details':
{'Code': 'AccessDenied', 'Message': \"Access denied by authorizer's policy.\", 'RequestId':
'68021B03E0E4E53535128F40', 'HostId': 'xxx.oss-cn-hangzhou.aliyuncs.com',
'AccessDeniedDetail': '\\n ', 'EC': '0003-00000301', 'RecommendDoc': 'https://api.aliyun.
com/troubleshoot?q=0003-00000301'}}", "stackTrace": "\nThe above exception was the direct
cause of the following exception:\n\nTraceback (most recent call last):\n File \"/usr/..."}}報錯原因:當使用Faiss作為向量資料庫時,應用流產生的索引檔案沒有許可權儲存至已配置的OSS路徑。
解決方案:使用PAI預設角色,重新建立知識庫索引,並確保將參數輸出OSS路徑配置為當前工作空間預設儲存路徑所在的OSS Bucket下的任一目錄。然後在應用流中重新設定知識庫索引節點,詳情請參見知識庫索引管理-建立知識庫索引。
在DSW執行個體的啟動運行時彈窗中,將執行個體RAM角色設定為PAI預設角色。
計費
Q:沒有建立DSW執行個體,僅使用了PAI-LangStudio功能,為什麼會產生PAI-DSW的計費
LangStudio建立應用流開發模式後,啟動運行時會使用DSW資源併產生費用。請根據實際使用方式,及時在DSW執行個體列表中停止對應執行個體,以免產生額外費用。