Install
Prerequisites
Section titled “Prerequisites”- Python 3.10+
- A model API key:
OPENAI_API_KEY(default provider), orOPENROUTER_API_KEYif you use OpenRouter, or Azure credentials if you use Azure OpenAI - Optional tool keys depending on your toolset (for example
EXA_API_KEYfor web/literature search)
Install from source
Section titled “Install from source”pip install -e .Verify the CLI
Section titled “Verify the CLI”faraday --helpSet LLM Provider Credentials
Section titled “Set LLM Provider Credentials”OpenAI (default)
Section titled “OpenAI (default)”export OPENAI_API_KEY=...In faraday.yaml, the default matches the example config (llm.provider: openai, api_key_env: OPENAI_API_KEY).
OpenRouter
Section titled “OpenRouter”OpenRouter exposes an OpenAI-compatible API. Faraday uses the base URL https://openrouter.ai/api/v1 when llm.provider is openrouter.
-
Create a key in the OpenRouter dashboard and export it:
Terminal window export OPENROUTER_API_KEY=... -
Point
faraday.yamlat OpenRouter and choose a model id (for exampleopenai/gpt-4ooranthropic/claude-3.5-sonnet):llm:provider: openroutermodel: openai/gpt-4oapi_key_env: OPENROUTER_API_KEY -
Optional: OpenRouter recommends
HTTP-RefererandX-Titleheaders for rankings and analytics. You can set them underllm.default_headers(see comments infaraday.example.yaml).
Do not put secret values in YAML; keep the key in the environment variable named by api_key_env.
Check required API keys and tool credentials
Section titled “Check required API keys and tool credentials”Run:
faraday --check-toolsThis command checks these keys:
- Agent / LLM:
faraday --check-toolsalways listsOPENAI_API_KEYunder agent keys. If you use OpenRouter only, configurellm.provider: openrouterandOPENROUTER_API_KEYas above; the main agent uses that key. Some optional tools still declareOPENAI_API_KEYin their own rows if they rely on it. - Tool-dependent:
EXA_API_KEY - Modal backend only:
MODAL_TOKEN_ID,MODAL_TOKEN_SECRET
Setting Up Code Execution
Section titled “Setting Up Code Execution”Docker-based Code Sandbox (recommended)
Section titled “Docker-based Code Sandbox (recommended)”Step 1: Build docker images for the Faraday app and code execution sandbox
docker build -f Dockerfile.main -t faraday-oss .docker build -f Dockerfile.sandbox -t faraday-code-sandbox .Step 2: Configure faraday.yaml to use docker backend
execution: backend: docker workspace_root: /path/to/agent_workspace/Step 3: Set workspace
You have two options for setting the code sandbox workspace
- Using your local filesystem as the workspace
- Using a copy of your local filesystem as the workspace in a ctonainer.
Option 1: Using your local filesystem as the workspace
If the workspace_root is not set, Faraday will use the current working directory, mounted into the code sandbox, in it’s work. The specific path will set the agent’s workspace root for the code sandbox.
Use this when you are fine with changes to your local filesystem.
execution: backend: docker workspace_root: /path/to/agent_workspace/ # or leave blank to use the current working directoryOption 2: Use a copy of your local filesystem as the workspace (safer)
Combined with setting the Faraday agent to run in docker, this will create a copy of your local workspace_root directory as the workspace for the code sandbox.
runtime: backend: docker # host | docker
execution: backend: docker workspace_root: /path/to/agent_workspace/ # or leave blank to use the current working directoryModal-based Code Sandbox
Section titled “Modal-based Code Sandbox”Use the Modal sandbox feature for code execution.
modal: runs code execution in Modal sandboxes; useful for remote isolated execution
Configure faraday.yaml to use modal backend:
(in faraday.example.yaml)
execution: backend: modalSet credentials and then validate:
export MODAL_TOKEN_ID=...export MODAL_TOKEN_SECRET=...faraday --check-toolsRun code locally
Section titled “Run code locally”Run code using your local python / bash interpreter.
This is generally not recommended due to variability in the execution environment.
execution: backend: host workspace_root: .Next step
Section titled “Next step”Go to Quickstart to run your first task.