<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Alexis Majorel</title>
    <description>The latest articles on Forem by Alexis Majorel (@alexis_majorel_bd09fc2a69).</description>
    <link>https://forem.com/alexis_majorel_bd09fc2a69</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3889153%2Fe850e060-25ec-45c8-9edf-72dc971a4cf3.png</url>
      <title>Forem: Alexis Majorel</title>
      <link>https://forem.com/alexis_majorel_bd09fc2a69</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/alexis_majorel_bd09fc2a69"/>
    <language>en</language>
    <item>
      <title>LLM Budget Forge</title>
      <dc:creator>Alexis Majorel</dc:creator>
      <pubDate>Tue, 21 Apr 2026 16:59:01 +0000</pubDate>
      <link>https://forem.com/alexis_majorel_bd09fc2a69/llm-budget-forge-41hi</link>
      <guid>https://forem.com/alexis_majorel_bd09fc2a69/llm-budget-forge-41hi</guid>
      <description>&lt;p&gt;Here is the English version of the article, optimized for a tech audience (GitHub, LinkedIn, or a technical blog).&lt;/p&gt;

&lt;p&gt;Stop the Bleeding: Take Control of Your LLM Costs with LLM BudgetForge&lt;br&gt;
For any developer or startup building with AI, the scenario is painfully familiar: you launch a project using OpenAI or Anthropic APIs, only to wake up to a massive, unexpected bill. Whether it’s caused by a runaway loop, inefficient prompts, or high-volume usage of premium models like GPT-4o or Claude 3.5 Sonnet, costs can spiral out of control in hours.&lt;/p&gt;

&lt;p&gt;This is exactly why LLM BudgetForge was built.&lt;/p&gt;

&lt;p&gt;What is LLM BudgetForge?&lt;br&gt;
LLM BudgetForge is an open-source, self-hosted proxy that sits directly between your application code and your LLM providers (OpenAI, Anthropic, Google).&lt;/p&gt;

&lt;p&gt;Think of it as a smart "financial firewall" for your AI development. It monitors your consumption in real-time and enforces strict budgetary rules that you define.&lt;/p&gt;

&lt;p&gt;Key Features to Protect Your Bottom Line&lt;br&gt;
Unlike basic monitoring tools, BudgetForge offers active management to ensure your services stay online without breaking the bank:&lt;/p&gt;

&lt;p&gt;Strict Per-Project Budgets: Set a hard limit for each project. Once the cap is hit, the proxy blocks further requests to prevent overages.&lt;/p&gt;

&lt;p&gt;Automatic Downgrading (Model Fallback): Perhaps the most innovative feature—if your "premium" budget is exhausted, BudgetForge can automatically reroute calls to a cheaper model (e.g., switching from GPT-4 to GPT-4o-mini) to maintain functionality at a fraction of the cost.&lt;/p&gt;

&lt;p&gt;Slack &amp;amp; Email Alerts: Stay informed with instant notifications when you hit 50%, 80%, or 100% of your allocated budget.&lt;/p&gt;

&lt;p&gt;Usage Dashboard &amp;amp; CSV Export: Visualize your spending patterns and export data for deep-dive analysis or accounting.&lt;/p&gt;

&lt;p&gt;Team Management: Manage multiple team members and project keys from a single, centralized interface.&lt;/p&gt;

&lt;p&gt;2-Line Integration&lt;br&gt;
One of the best parts of LLM BudgetForge is how non-intrusive it is. You don't need to rewrite your business logic. Just swap your API key and update the base URL in your existing client.&lt;/p&gt;

&lt;p&gt;Example in Python:&lt;/p&gt;

&lt;p&gt;Python&lt;br&gt;
from openai import OpenAI&lt;/p&gt;

&lt;h1&gt;
  
  
  Seamless integration via the BudgetForge proxy
&lt;/h1&gt;

&lt;p&gt;client = OpenAI(&lt;br&gt;
    api_key="bf-your-project-key",&lt;br&gt;
    base_url="&lt;a href="https://your-instance/proxy/openai" rel="noopener noreferrer"&gt;https://your-instance/proxy/openai&lt;/a&gt;"&lt;br&gt;
)&lt;br&gt;
The Power of Open Source &amp;amp; Self-Hosting&lt;br&gt;
Because LLM BudgetForge is free and self-hosted, you get the best of both worlds:&lt;/p&gt;

&lt;p&gt;Privacy &amp;amp; Security: Your API keys and request logs never leave your infrastructure.&lt;/p&gt;

&lt;p&gt;Zero Middleman Fees: You don’t pay a subscription fee just to manage your costs.&lt;/p&gt;

&lt;p&gt;Complete Customization: Modify the code to fit your specific enterprise workflow.&lt;/p&gt;

&lt;p&gt;Ready to Forge Your Budget?&lt;br&gt;
Stop letting API bill anxiety stifle your innovation. Join the community, try the tool, and take back control of your AI spending.&lt;/p&gt;

&lt;p&gt;Live Demo: &lt;a href="https://lnkd.in/dPhRhcQM" rel="noopener noreferrer"&gt;https://lnkd.in/dPhRhcQM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://lnkd.in/dJb4jP6R" rel="noopener noreferrer"&gt;https://lnkd.in/dJb4jP6R&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>opensource</category>
      <category>agents</category>
    </item>
    <item>
      <title>How I aggregate 5 price sources into one confidence-scored feed for AI agents</title>
      <dc:creator>Alexis Majorel</dc:creator>
      <pubDate>Mon, 20 Apr 2026 14:26:11 +0000</pubDate>
      <link>https://forem.com/alexis_majorel_bd09fc2a69/how-i-aggregate-5-price-sources-into-one-confidence-scored-feed-for-ai-agents-i9i</link>
      <guid>https://forem.com/alexis_majorel_bd09fc2a69/how-i-aggregate-5-price-sources-into-one-confidence-scored-feed-for-ai-agents-i9i</guid>
      <description>&lt;p&gt;Most AI agents that need market prices do the same thing: call one API, trust the number, move on.&lt;br&gt;
That works until it doesn't.&lt;br&gt;
A single source going stale, returning a wrong price during a flash crash, or simply being down — and your agent acts on bad data with no way to know.&lt;br&gt;
I spent several months building MAXIA Oracle to fix this. Here's the architecture and what I learned.&lt;/p&gt;

&lt;p&gt;The core idea: confidence over precision&lt;br&gt;
The insight that drove the design: an agent doesn't need the "perfect" price. It needs to know how much to trust the price it got.&lt;br&gt;
Every response from MAXIA Oracle returns three things:&lt;br&gt;
    • The median price (cross-validated across sources)&lt;br&gt;
    • A confidence score (0–100)&lt;br&gt;
    • An inter-source divergence percentage&lt;br&gt;
If Pyth says BTC is $83,000 and CoinPaprika says $83,150, confidence is high (95), divergence is low (0.18%). The agent can act.&lt;br&gt;
If one source returns $80,000 and another $86,000, divergence spikes. The agent should pause and flag the discrepancy before executing anything.&lt;/p&gt;

&lt;p&gt;The 5 sources and why each one matters&lt;br&gt;
    1. Pyth Network (Solana)&lt;br&gt;
Pyth is the backbone. A single batch call to the Hermes HTTP API returns prices for up to 79 symbols in one round-trip — crypto majors, Solana ecosystem, US equities (AAPL, TSLA, NVDA), forex pairs, stablecoins.&lt;br&gt;
Each Pyth response includes a confidence interval and an expo field for precise decimal handling. The freshness check is critical: Pyth updates every 400ms on-chain, but if you're calling the REST API, you can get a cached value. I enforce a max staleness of 10 seconds.&lt;br&gt;
Pyth batch call — 79 symbols in one HTTP round-trip&lt;br&gt;
ids = [PYTH_IDS[sym] for sym in symbols if sym in PYTH_IDS] resp = await client.get( "&lt;a href="https://hermes.pyth.network/v2/updates/price/latest%22,%C2%A0params=%7B%22ids%5B%5D%22:" rel="noopener noreferrer"&gt;https://hermes.pyth.network/v2/updates/price/latest", params={"ids[]":&lt;/a&gt; ids, "parsed": "true"} )&lt;br&gt;
    1. Chainlink (Base mainnet)&lt;br&gt;
Chainlink is the independent verifier. It runs on a completely different infrastructure (EVM on-chain vs Solana), so a Pyth anomaly won't affect it.&lt;br&gt;
I call Chainlink via a direct RPC call to Base mainnet, reading the latestRoundData() function from each price feed contract. No intermediary, no API key — pure on-chain data.&lt;br&gt;
Direct on-chain read — no API key needed&lt;br&gt;
result = contract.functions.latestRoundData().call() price = result[1] / 10**decimals updated_at = result[3]  # Unix timestamp of last update&lt;br&gt;
The downside: Chainlink covers ~30 symbols on Base, so it can't verify everything. But for the major assets it covers, it's the most trustworthy cross-check available.&lt;br&gt;
    1. CoinPaprika&lt;br&gt;
CoinPaprika covers altcoins and memecoins that Pyth and Chainlink don't list. It's also useful as a CeFi reference — it aggregates exchange data, so it reflects what centralized markets are trading at.&lt;br&gt;
    1. RedStone&lt;br&gt;
RedStone fills the gaps between Pyth and CoinPaprika for DeFi-native assets. It also provides an alternative data path for some Pyth symbols, which is useful for divergence detection.&lt;br&gt;
    1. Uniswap v3 TWAP (Ethereum mainnet)&lt;br&gt;
The TWAP (Time-Weighted Average Price) from Uniswap v3 pools is manipulation-resistant by design — it's computed over a time window, so flash loan attacks can't spike it artificially. For high-value DeFi assets where on-chain trading volume matters, this is a strong signal.&lt;br&gt;
I use a 10-minute TWAP window and only include pools with at least $500k liquidity. Out of 8 pools I tested, 3 met this threshold with acceptable spread vs reference prices.&lt;/p&gt;

&lt;p&gt;The aggregation cascade&lt;br&gt;
The logic runs in priority order:&lt;br&gt;
    1. Pyth batch call → covers ~79 symbols&lt;br&gt;
    2. For each symbol NOT in Pyth → try Chainlink on-chain&lt;br&gt;
    3. For remaining gaps → CoinPaprika / RedStone&lt;br&gt;
    4. Uniswap v3 TWAP → parallel call, used as verification layer&lt;br&gt;
For each symbol with multiple sources, I compute:&lt;br&gt;
prices = [p for p in source_prices if p is not None] median_price = statistics.median(prices) divergence_pct = (max(prices) - min(prices)) / median_price * 100 confidence = compute_confidence(prices, divergence_pct, freshness)&lt;br&gt;
Confidence is penalized by: high divergence, stale data, single-source results, known circuit breaker trips.&lt;/p&gt;

&lt;p&gt;What surprised me&lt;br&gt;
    1. Pyth's confidence interval is underused. Every Pyth price comes with a ±conf value in the same units as the price. Most projects ignore it. I use it to weight Pyth's contribution in the aggregation — a tight confidence interval increases Pyth's weight.&lt;br&gt;
    2. On-chain is not always fresher. Chainlink updates on deviation threshold + heartbeat. For low-volatility assets, the on-chain price can be hours old. I always check updatedAt and reject stale answers.&lt;br&gt;
    3. Uniswap pool selection is the hard part. Finding pools where the TWAP is reliable took more work than the aggregation itself. Many pools have low liquidity, wide spreads, or are dominated by one LP. I ended up with only 3 pools I trust.&lt;/p&gt;

&lt;p&gt;Integration&lt;br&gt;
The MCP server runs at &lt;a href="https://oracle.maxiaworld.app/mcp/sse" rel="noopener noreferrer"&gt;https://oracle.maxiaworld.app/mcp/sse&lt;/a&gt; — drop it into Claude Desktop, Cursor, or any MCP client and your agent can call get_price("BTC") natively.&lt;br&gt;
Python&lt;br&gt;
pip install maxia-oracle&lt;br&gt;
TypeScript&lt;br&gt;
npm install @maxia-marketplace/oracle&lt;br&gt;
Free tier: 100 req/day, no signup&lt;br&gt;
curl -X POST &lt;a href="https://oracle.maxiaworld.app/api/register" rel="noopener noreferrer"&gt;https://oracle.maxiaworld.app/api/register&lt;/a&gt;&lt;br&gt;
91 symbols. Price history (24h/7d/30d). Alerts with webhooks. SSE streaming. Pay-per-call via x402 micropayments ($0.001 USDC on Base) for agents without API keys.&lt;/p&gt;

&lt;p&gt;Happy to answer questions about the aggregation logic, the on-chain read setup, or the x402 payment flow.&lt;br&gt;
Source: &lt;a href="https://github.com/majorelalexis-stack/oracleforge" rel="noopener noreferrer"&gt;https://github.com/majorelalexis-stack/oracleforge&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>blockchain</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
