Local vs Remote
Choose between local execution and remote deployment based on your development stage and infrastructure requirements.
Overview
The SDK supports two execution modes:
Local Mode โ Agents run directly on your machine using the
aip-agentslibraryRemote Mode โ Agents run on the remote server (via the
ai-agent-platformplatform, which usesaip-agentsinternally)
Both modes use the same Agent API, making it easy to switch between them. The SDK (glaip-sdk) can connect to either the platform's remote server or run agents locally using aip-agents directly.
Quick Comparison
โ๏ธ Setup
Install local extra and configure LLM provider key
Install SDK and configure remote API URL/key
๐ Credentials
LLM provider key + optional feature keys (memory, NER, tools)
AIP API URL + API key
๐ Deploy Step
No deploy step; run immediately
Deploy first to register agent
๐ฅ๏ธ Execution Location
Runs on your machine
Runs on remote server
๐ง LLM Provider
Local (via aip-agents)
Platform-managed or custom
Capability Checklist
๐ ๏ธ Tool calling (custom tools)
โ
โ
๐ MCP support
โ
โ
๐ง Model selection
โ
โ
๐งต Token streaming
โ
โ
๐งพ Tool output sharing
โ
โ
๐ค Sub-agent delegation
โ
โ
๐ง HITL
โ
โ (audit trail)
๐พ Persistent memory (mem0)
โ
โ
๐งฐ Built-in tool: Code Interpreter
โ
โ
๐งฐ Built-in tool: Browser Use
โ
โ
๐งฐ Built-in tool: Document Loader (PDF, DOCX, Excel)
โ
โ
๐ง Runtime config overrides
โ
โ
๐ต๏ธ PII
โ
โ
๐ Run with file attachments
โ
โ
๐ GL Connectors support
โ
โ
๐งฉ Built-in agents (e.g., Data Analyst)
โ
โ
๐ CRUD + Run REST API
โ
โ
๐๏ธ Agent registry (persistent storage)
โ
โ
๐ Run history/logs/metrics
โ (console only)
โ
โฐ Scheduling
โ
โ
๐ก Offline execution
โ
โ
Local Mode
Setup
The [local] extra includes aip-agents for local LLM execution.
Usage Pattern
Local Run Examples
All local features assume a configured LLM provider key (for example OPENAI_API_KEY). Additional required environment variables are listed per feature below.
Example .env (include only what you use):
Built-in tool: Document Loader (PDFReaderTool, DocxReaderTool, ExcelReaderTool)
None beyond LLM provider key
Native aip-agents tools (web search, code sandbox, browser use)
SERPER_API_KEY (GoogleSerperTool), E2B_API_KEY (E2BCodeSandboxTool); other tools may require their own env
PII toggle (enable_pii)
Optional NER_API_URL and NER_API_KEY for NER-backed masking
Tool output sharing (agent_config.tool_output_sharing)
None beyond LLM provider key
Runtime config overrides
ARXIV_MCP_API_KEY and ARXIV_MCP_AUTH_TOKEN (optional, for Arxiv MCP)
Definition-time configs (tool_configs, mcp_configs, agent_config)
ARXIV_MCP_API_KEY and ARXIV_MCP_AUTH_TOKEN (optional, for Arxiv MCP)
MCPs with local transport
ARXIV_MCP_API_KEY and ARXIV_MCP_AUTH_TOKEN (optional, for Arxiv MCP)
GL Connectors
GL_CONNECTORS_BASE_URL, GL_CONNECTORS_API_KEY, GL_CONNECTORS_USERNAME, GL_CONNECTORS_PASSWORD; optional GL_CONNECTORS_IDENTIFIER
Tool Output Sharing Quickstart (Local)
The hello-world-local project ships with main_with_tool_output_sharing.py, which wires two LangChain-compatible tools together and enables $tool_output.<call_id> references through agent_config={"tool_output_sharing": True}. Use this path when you want to stage multi-step tool workflows locally before promoting them to the remote platform.
Install dependencies:
pip install "glaip-sdk[local]"(includesaip-agents).Copy
.env.examplefrompython/gl-agents/projects/hello-world-localand setOPENAI_API_KEY.Run
python main_with_tool_output_sharing.pyto watch the agent perform a two-step greeting workflow with shared tool responses.
The script prints both the intermediate explanation (including the call_id reference) and the final formatted greeting, mirroring the same workflow you would deploy remotely once satisfied with the run.
Remote Mode
Remote mode connects to the platform's remote server, which uses aip-agents internally to execute agents.
Setup
Usage Pattern
Switching Between Modes
Best practice: Use instances instead of strings for seamless migration between modes.
Local Override for Deployed Agents
You can force local execution for an agent that has already been deployed to the remote server by passing local=True to run() or arun().
Seamless Migration Example
Local mode does not support string references or platform-only helpers (Tool.from_native(), MCP.from_native()). Use LangChain BaseTool classes/instances or Tool.from_langchain() for tools, and MCP instances with local transport configs (http, sse, stdio). Add native tools or MCPs only when deploying to the platform.
Migration Path: Local โ Remote
Test locally with
agent.run()(usesaip-agentsdirectly)Configure AIP server credentials (
AIP_API_URL,AIP_API_KEY)Add
deploy()call before first remote runVerify remote run with same inputs
Migration Path: Remote โ Local
Install local extra:
pip install "glaip-sdk[local]"(includesaip-agents)Set
OPENAI_API_KEYenvironment variableRemove
deploy()calls from code (not needed for local execution)Replace string/native references with instances if any exist
Decision Checklist
Use Remote Mode (AIP server) if you need any capability that is remote-only (โ on Remote, โ on Local). Otherwise, use Local Mode (aip-agents directly).
Common Patterns
Pattern 1: Local Development, Remote Production
Pattern 2: Conditional Mem0 Usage
Pattern 3: Testing Locally, Running on Remote
Troubleshooting
Agent not found
N/A (ephemeral)
Check aip agents list
Missing dependencies
Install glaip-sdk[local] (includes aip-agents)
Upload tools to AIP server
Authentication error
N/A
Verify AIP_API_KEY for AIP server
Memory not persisting
Check MEM0_API_KEY and agent_config.memory
Check agent_config.memory and AIP server mem0 setup
Slow execution
Check local LLM config
Check network latency to remote server
Related Documentation
Install & Configure โ Setup for both modes
Quick Start Guide โ First agent in each mode
Agents Guide โ Full agent lifecycle
Configuration Management โ Promote agents between environments
Last updated