Skip to content

Needs light modification to run with Ollama #59

@gbetous

Description

@gbetous

To make the (amazing !) tutorial work with Ollama (it works great with qwen3-coder) I have to modify every agent to remove those two lines.

diff --git a/agents/s01_agent_loop.py b/agents/s01_agent_loop.py
index 3e6c913..893a3d7 100644
--- a/agents/s01_agent_loop.py
+++ b/agents/s01_agent_loop.py
@@ -31,9 +31,6 @@ from dotenv import load_dotenv
 
 load_dotenv(override=True)
 
-if os.getenv("ANTHROPIC_BASE_URL"):
-    os.environ.pop("ANTHROPIC_AUTH_TOKEN", None)
-
 client = Anthropic(base_url=os.getenv("ANTHROPIC_BASE_URL"))
 MODEL = os.environ["MODEL_ID"]

What is their purpose ? I can prepare a PR to allow usage on both Claude and Ollama but I don't understand the basic need.

Thanks !

FYI, my .env content:

ANTHROPIC_AUTH_TOKEN=ollama
ANTHROPIC_API_KEY=""
ANTHROPIC_BASE_URL=http://localhost:11434
MODEL_ID=qwen3-coder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions