ollama_semaphore = asyncio.Semaphore(OLLAMA_MAX_CONCURRENCY) async def _build_section_safe(name): if not use_cloud: async with ollama_semaphore: return await _build_section(name, workspace_id, workspace_path) return await _build_section(name, workspace_id, workspace_path)