<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>AI - Category - Home Page Arkadios</title><link>http://arkadios.me/categories/ai/</link><description>AI - Category - Home Page Arkadios</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 07 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="http://arkadios.me/categories/ai/" rel="self" type="application/rss+xml"/><item><title>Running TradingAgents with existing AI subscriptions</title><link>http://arkadios.me/post/setting-up-tradingagents-locally/</link><pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate><author>Arkadios Tsamourliadis</author><guid>http://arkadios.me/post/setting-up-tradingagents-locally/</guid><description><![CDATA[<h1 id="running-tradingagents-locally">Running TradingAgents locally</h1>
<p><a href="https://github.com/tauricresearch/tradingagents" target="_blank" rel="noopener noreffer ">Tauric TradingAgents</a> is an open source project
that uses several AI agents to work through investment research. The agents take on different roles:
analysts, researchers, a trader, risk reviewers, and a portfolio manager. The project&rsquo;s README
explains how they work together. This post covers how I connected the framework to cloud and local
models, with a rate limiter to keep requests under control.</p>
<p>The usual setup needs API keys for cloud models. I already had AI subscriptions and wanted to use
whatever allowance I had left in those instead of paying separately for API calls.
So I put a local model gateway on my MacBook. It lets me inspect the traffic and limit requests,
and I can switch providers without changing the TradingAgents code.</p>
<p>Neither this article nor the TradingAgents project is financial advice. I treat the output as
AI-generated research notes that need checking, rather than a reason to buy or sell.</p>
<h2 id="the-architecture-of-my-deployment">The Architecture of my deployment</h2>
<p>My local setup looks like this:</p>
<div class="mermaid" id="id-2">    Simple architecture diagram;
        Terminal --&gt; TradingAgents (App);
        TradingAgents (App) --&gt; Local Rate Limiter (Port 8318);
        Local Rate Limiter (Port 8318) --&gt; CLIProxyAPI Gateway (Port 8317);
        CLIProxyAPI Gateway (Port 8317) --&gt; Upstream Providers (Gemini, Codex, LM Studio Server, etc.);</div><p>CLIProxyAPI gives TradingAgents an OpenAI-compatible endpoint. Behind that endpoint, I can use
Gemini or Codex (or any other OpenAI-compatible LLM provider) through my subscriptions, or connect a local model. TradingAgents handles the
research; CLIProxyAPI handles access to whichever provider I choose.</p>
<p>The rate limiter sits between TradingAgents and the gateway. Several agents can send requests
at once, which can trigger provider limits, especially when using a subscription.
The small token-bucket proxy lets me control how quickly those requests reach the gateway.</p>
<h2 id="before-you-start">Before you start</h2>
<p>I used a MacBook with Homebrew and Python 3.10+. You can run the setup on another machine,
though the Homebrew and macOS service commands below will need adapting.</p>
<p>I kept the Python environment in a <code>.venv</code> folder inside the project so it was easy to find
and inspect. If you prefer Conda or Docker, the upstream README covers those options.</p>
<h2 id="1-install-tradingagents-in-a-local-virtual-environment">1. Install TradingAgents in a local virtual environment</h2>
<p>Clone the <a href="https://github.com/TauricResearch/TradingAgents" target="_blank" rel="noopener noreffer ">Tauric TradingAgents repository</a>,
then create a virtual environment and install the project:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git clone https://github.com/TauricResearch/TradingAgents.git
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> TradingAgents
</span></span><span class="line"><span class="cl">python3 -m venv .venv
</span></span><span class="line"><span class="cl">.venv/bin/python -m pip install --upgrade pip
</span></span><span class="line"><span class="cl">.venv/bin/python -m pip install .</span></span></code></pre></div></div>
<p>To run <code>tradingagents</code> from any shell, add a symlink in a directory on your <code>PATH</code>.
For example, with <code>~/.local/bin</code>:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ln -s <span class="s2">&#34;</span><span class="nv">$PWD</span><span class="s2">/.venv/bin/tradingagents&#34;</span> ~/.local/bin/tradingagents</span></span></code></pre></div></div>
<p>Make sure <code>~/.local/bin</code> is on your <code>PATH</code> for this shortcut to work.</p>
<h2 id="2-install-cliproxyapi-and-sign-in-to-your-providers">2. Install CLIProxyAPI and sign in to your providers</h2>
<p>CLIProxyAPI is the part that connects to an existing subscription, such as Google AI Pro
or OpenAI Codex. TradingAgents sends its requests to the local gateway.</p>
<p>Install CLIProxyAPI with Homebrew:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">brew install cliproxyapi</span></span></code></pre></div></div>
<p>Sign in to each provider you want to use. For Gemini, this opens a browser login:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cliproxyapi -login</span></span></code></pre></div></div>
<p>For Codex, use the device login flow:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cliproxyapi -codex-device-login</span></span></code></pre></div></div>
<p>Then restart the service:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">brew services restart cliproxyapi</span></span></code></pre></div></div>
<p>CLIProxyAPI saves the authentication tokens as <code>.json</code> files in <code>~/.cli-proxy-api</code>.</p>
<p>With my Homebrew installation, the configuration file is here:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">/opt/homebrew/etc/cliproxyapi.conf</span></span></code></pre></div></div>
<p>I&rsquo;m also sharing an example file in my config repo: <a href="https://github.com/atsamour/tradingagents-proxy-config" target="_blank" rel="noopener noreffer ">https://github.com/atsamour/tradingagents-proxy-config</a></p>
<p>The template binds CLIProxyAPI to localhost and enables its Management Center.
It also defines the client key that TradingAgents will send with requests; you&rsquo;ll put that key
in the TradingAgents <code>.env</code> file later. Optional providers that use API keys stay disabled
until you supply their keys.</p>
<p>There are two local keys to keep track of:</p>
<ul>
<li>a client API key for requests from TradingAgents to CLIProxyAPI</li>
<li>a management key for CLIProxyAPI&rsquo;s Management Center</li>
</ul>
<p>Generate both keys and save their values. You&rsquo;ll need them again when configuring TradingAgents
and signing in to the Management Center:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">CLIENT_KEY</span><span class="o">=</span><span class="s2">&#34;tradingagents-</span><span class="k">$(</span>openssl rand -hex 24<span class="k">)</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nv">MGMT_KEY</span><span class="o">=</span><span class="s2">&#34;mgmt-</span><span class="k">$(</span>openssl rand -hex 24<span class="k">)</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="nv">$CLIENT_KEY</span>
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="nv">$MGMT_KEY</span></span></span></code></pre></div></div>
<p>Back up the current configuration, replace the template&rsquo;s placeholders with your keys,
then install it and restart CLIProxyAPI:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cp /opt/homebrew/etc/cliproxyapi.conf /opt/homebrew/etc/cliproxyapi.conf.backup
</span></span><span class="line"><span class="cl">cp config/cliproxyapi.conf.example /tmp/cliproxyapi.conf
</span></span><span class="line"><span class="cl">perl -0pi -e <span class="s2">&#34;s/tradingagents-REPLACE_WITH_GENERATED_CLIENT_KEY/</span><span class="nv">$CLIENT_KEY</span><span class="s2">/g; s/mgmt-REPLACE_WITH_GENERATED_MANAGEMENT_KEY/</span><span class="nv">$MGMT_KEY</span><span class="s2">/g&#34;</span> /tmp/cliproxyapi.conf
</span></span><span class="line"><span class="cl">install -m <span class="m">600</span> /tmp/cliproxyapi.conf /opt/homebrew/etc/cliproxyapi.conf
</span></span><span class="line"><span class="cl">brew services restart cliproxyapi</span></span></code></pre></div></div>
<p>If your Homebrew directory requires elevated permissions, use them only for the <code>install</code> step.</p>
<p>Open the Management Center at:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">http://127.0.0.1:8317/management.html#/login</span></span></code></pre></div></div>
<p>Sign in with the <code>MGMT_KEY</code> you generated above.</p>
<p>I keep CLIProxyAPI and its Management Center on the same machine as TradingAgents.
You could also run the gateway on a separate machine and configure network access to it.</p>
<h2 id="3-point-tradingagents-at-the-local-gateway">3. Point TradingAgents at the local gateway</h2>
<p>TradingAgents lets you override its model settings with environment variables.
Create a <code>.env</code> file in the TradingAgents repository:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># .env (Local Overrides)</span>
</span></span><span class="line"><span class="cl"><span class="nv">OPENAI_API_KEY</span><span class="o">=</span>CLIENT_KEY
</span></span><span class="line"><span class="cl"><span class="nv">TRADINGAGENTS_LLM_PROVIDER</span><span class="o">=</span>gemini
</span></span><span class="line"><span class="cl"><span class="nv">TRADINGAGENTS_LLM_BACKEND_URL</span><span class="o">=</span>http://127.0.0.1:8318/v1
</span></span><span class="line"><span class="cl"><span class="nv">TRADINGAGENTS_DEEP_THINK_LLM</span><span class="o">=</span>gemini-3.1-pro-preview
</span></span><span class="line"><span class="cl"><span class="nv">TRADINGAGENTS_QUICK_THINK_LLM</span><span class="o">=</span>gemini-3.1-flash-lite-preview
</span></span><span class="line"><span class="cl"><span class="nv">ALPHA_VANTAGE_API_KEY</span><span class="o">=</span>your-alphavantage-key-here
</span></span><span class="line"><span class="cl"><span class="nv">CLIPROXYAPI_MANAGEMENT_KEY</span><span class="o">=</span>your-generated-<span class="nv">$MGMT_KEY</span></span></span></code></pre></div></div>
<p>Get the ALPHA_VANTAGE_API_KEY here: <a href="https://www.alphavantage.co/support/#api-key" target="_blank" rel="noopener noreffer ">https://www.alphavantage.co/support/#api-key</a>. It is a stock market data retrieval API.</p>
<p>Use the <code>CLIENT_KEY</code> value you generated in the previous step.
The backend URL points to the rate limiter on port <code>8318</code>, a small Python script built with
<code>aiohttp</code>. Sending requests through it lets me control how quickly the agents use my subscription.</p>
<p>To find model names for <code>TRADINGAGENTS_DEEP_THINK_LLM</code> and <code>TRADINGAGENTS_QUICK_THINK_LLM</code>, run:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">scripts/app/tradingagents_models.sh list</span></span></code></pre></div></div>
<p>Or query the model endpoint directly:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">curl -fsS \
</span></span><span class="line"><span class="cl">  -H &#34;Authorization: Bearer mgm-token-here&#34; \
</span></span><span class="line"><span class="cl">  http://127.0.0.1:8318/v1/models</span></span></code></pre></div></div>
<p>Start the local rate limiter with:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter_service.sh submit</span></span></code></pre></div></div>
<h2 id="4-set-up-the-rate-limiter">4. Set up the rate limiter</h2>
<p>CLIProxyAPI already handles retries, provider routing, and cooldowns.
I also wanted a requests-per-minute limit that I could set myself, right at the endpoint
TradingAgents calls.</p>
<p>The limiter is a small <code>aiohttp</code> reverse proxy in:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter.py</span></span></code></pre></div></div>
<p>It listens on <code>127.0.0.1:8318</code> and forwards requests to <code>127.0.0.1:8317</code>.
You can check its health at:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">http://127.0.0.1:8318/healthz</span></span></code></pre></div></div>
<p>I use these conservative defaults:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">10 requests per minute, burst 3</span></span></code></pre></div></div>
<p>To change them, edit:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">config/cliproxyapi-rate-limiter.env</span></span></code></pre></div></div>
<p>To keep the limiter running as a macOS service through <code>launchd</code>, use:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter_service.sh submit
</span></span><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter_service.sh status</span></span></code></pre></div></div>
<p>For a foreground session that you start and stop yourself, use:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter_service.sh start
</span></span><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter_service.sh status
</span></span><span class="line"><span class="cl">scripts/app/cliproxyapi_rate_limiter_service.sh stop</span></span></code></pre></div></div>
<p>When a request includes a bearer token, the limiter uses its API key to choose a bucket.
That keeps request limits separate if several local clients use the gateway with different keys.</p>
<h2 id="5-switch-models-without-editing-env-by-hand">5. Switch models without editing <code>.env</code> by hand</h2>
<p>It&rsquo;s easy to put a model name in <code>.env</code> that TradingAgents accepts but the gateway can&rsquo;t serve.
The helper script checks CLIProxyAPI&rsquo;s current model list before updating the file,
so you can catch that mistake before starting a run.</p>
<p>List available models:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/tradingagents_models.sh list</span></span></code></pre></div></div>
<p>Check which models TradingAgents is currently set to use:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/tradingagents_models.sh show</span></span></code></pre></div></div>
<p>Use the Gemini preset:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/tradingagents_models.sh preset gemini</span></span></code></pre></div></div>
<p>Use the Codex preset:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/tradingagents_models.sh preset codex</span></span></code></pre></div></div>
<p>Or choose the model IDs yourself:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/tradingagents_models.sh <span class="nb">set</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">  --deep gemini-3.1-pro-preview <span class="se">\
</span></span></span><span class="line"><span class="cl">  --quick gemini-3.1-flash-lite-preview</span></span></code></pre></div></div>
<p>TradingAgents may warn that your Gemini or Codex model isn&rsquo;t in its built-in OpenAI model catalog.
That&rsquo;s expected when using the proxy. The helper checks the gateway&rsquo;s <code>/v1/models</code> response
to confirm which models it can serve.</p>
<p>Here are a few watchlist runs using the Gemini and Codex presets:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/run_stock_watchlist.sh --mode news --model gemini PLTR GOOGL RHM.DE
</span></span><span class="line"><span class="cl">scripts/app/run_stock_watchlist.sh --mode potential --model codex PLTR GOOGL RHM.DE
</span></span><span class="line"><span class="cl">scripts/app/run_stock_watchlist.sh --mode full --model gemini PLTR</span></span></code></pre></div></div>
<p>To preview the command without starting the research run, add <code>--dry-run</code>:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/run_stock_watchlist.sh --mode news --model gemini --dry-run PLTR</span></span></code></pre></div></div>
<p>The wrapper saves reports under:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-text">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">runs/tradingagents/&lt;TICKER&gt;/&lt;DATE&gt;/summary.md
</span></span><span class="line"><span class="cl">runs/tradingagents/&lt;TICKER&gt;/&lt;DATE&gt;/reports/</span></span></code></pre></div></div>
<h3 id="check-the-setup">Check the setup</h3>
<p>Before starting a full research run, I use the doctor script to check the setup.
It checks the Homebrew service and listening ports, then the Management Center,
provider status, and model selection. It also checks that the CLI starts and sends
a small completion request through the limiter:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/setup/tradingagents_doctor.sh</span></span></code></pre></div></div>
<p>This script checks if the ports are open, if the providers are authenticated, and runs a &ldquo;smoke test&rdquo; completion.</p>
<h2 id="run-a-research-session">Run a research session</h2>
<p>Once those checks pass, I start the TradingAgents CLI for an interactive session:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">tradingagents</span></span></code></pre></div></div>
<p>You can choose which analyst teams to run, for example <code>market,news,fundamentals</code>.
Tickers can come from any market Yahoo Finance covers, including symbols such as <code>AAPL</code>,
<code>0700.HK</code>, or <code>BTC-USD</code>.</p>
<p>When I want to repeat the same research across a watchlist, I use the batch wrapper.
It saves the results as Markdown:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scripts/app/run_stock_watchlist.sh --mode full --model gemini PLTR GOOGL</span></span></code></pre></div></div>
<p>The reports go into <code>runs/tradingagents/</code>. I can read through the bull and bear arguments
later without running the models again.</p>
<h2 id="final-thoughts">Final Thoughts</h2>
<p>I started this because I wanted to run TradingAgents locally without paying for extra API calls.
Keeping provider access in CLIProxyAPI and request limits in a separate proxy made the setup easier to manage.</p>
<p>If you&rsquo;re trying something similar, I&rsquo;d recommend putting a gateway between your agents and the providers.
Being able to see the requests and slow them down when needed ensures that your AI subscription won&rsquo;t get banned.
It also gives you a place to start looking when an agent appears to be stuck or even review how agents operate based on the input they get.</p>
<p>As a next step I would like to run some benchmarks with past starting date (TradingAgenst support it!) and see if predictions are accurate and when not,
analyse why. Will post in due time.</p>
<p>Please feel free to share your experience with useing TradingAgents and don&rsquo;t hesitate to comment if yuou have any issues running them locally, as described here.</p>
<p>NOTES:</p>
<ul>
<li>Τhis was tested on TradingAgents v0.2.5</li>
<li></li>
<li>All configs and scripts can be found here: <a href="https://github.com/atsamour/tradingagents-proxy-config" target="_blank" rel="noopener noreffer ">https://github.com/atsamour/tradingagents-proxy-config</a></li>
</ul>
]]></description></item></channel></rss>