Credentials. Model provider API keys are read from your environment, so keep them out of source code and shared workspace files.
Who it is forA Python developer who needs an agent in production and wants to change model providers without rewriting the agent.
The problemWiring a model, tools, and checkpoints into a deployable agent takes many decisions, and locking into one provider makes switching costly.
The outcomeA working HarnessAgent that answers prompts through a model chosen by configuration, with failures raised as exceptions for the host to handle.
What you need first
- Python 3.12 or newer
- An API key for at least one model provider (OpenAI, Anthropic, AWS Bedrock, or an OpenAI-compatible endpoint)
Steps
- Confirm Python 3.12 or newer is installed.
- Install the package with
pip install octop-harness. (inferred, check the README) - Export your provider API key as an environment variable in your shell.
- Run
octop-harness initto create an agent workspace. (inferred, check the README) - Create a HarnessAgent through HarnessAgentManager, send a prompt with call(), and wrap the call in exception handling.
Prompt for your agent
In the TencentCloud/octop-harness repo, create a HarnessAgentManager with one agent that uses the model provider <provider>. Send the prompt <prompt> through call() and return the reply. Verify the reply is non-empty and that exceptions from call() are caught.
Caveat. The README does not give the exact pip install command, so the install step above is inferred and should be checked against the project's install docs.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for TencentCloud/octop-harness and "Run a production agent with swappable model providers"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer