<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sali on Medium]]></title>
        <description><![CDATA[Stories by Sali on Medium]]></description>
        <link>https://medium.com/@sali_13462?source=rss-710a951d832b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*EE1HZpoKOyEeynfL</url>
            <title>Stories by Sali on Medium</title>
            <link>https://medium.com/@sali_13462?source=rss-710a951d832b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:52:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sali_13462/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Databases on NEXUS AI: Managed, Portable, and Ready for AI-Built Apps]]></title>
            <link>https://medium.com/@sali_13462/databases-on-nexus-ai-managed-portable-and-ready-for-ai-built-apps-72be8c6819be?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/72be8c6819be</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-database]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Tue, 27 Oct 2026 14:11:01 GMT</pubDate>
            <atom:updated>2026-10-27T14:11:01.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g89WO_JiAnkvoqANBXMmnQ.png" /></figure><p><strong>Author:</strong> NEXUS AI Team</p><p><strong>Category:</strong> Databases · Platform · AI Deployments</p><p><strong>Reviewed:</strong> October 26, 2026</p><p><strong>CLI syntax verified:</strong> NEXUS AI CLI 4.3.2</p><p><strong>Reading time:</strong> 13 minutes</p><p>Most AI-built apps fail at the same point. The interface works, the demo impresses, and then someone asks where the data lives, who backs it up, and what happens when the AI agent runs a migration at 2 a.m.</p><p>Generating code got fast. Running the database underneath it did not get any easier.</p><p>NEXUS AI gives every app a database path that matches where it is in its life: a database that starts with the app, a standalone database you share between apps, the same database in your own AWS, Azure, or Google Cloud account, and a guarded way to connect databases you already run. One dashboard, one CLI, and one MCP server manage all of them.</p><p>This article explains what each option is, where to use it, how it looks from a management point of view, how portable your data stays, and why the design fits AI deployments in particular.</p><h3>What NEXUS AI databases are</h3><p>NEXUS AI databases are the data layer of the NEXUS AI deployment platform. There are four ways to use them:</p><p>OptionWhat it isEnginesManage with<strong>App database service</strong>A database that runs next to one app, created with the deployPostgreSQL, MySQL, MongoDB, Redisnexus db<strong>Managed database on NEXUS AI</strong>A standalone database you create once and attach to any app on NEXUS AIPostgreSQL, Redisnexus managed-db --local<strong>Managed cloud database</strong>A standalone database on Amazon RDS, Google Cloud SQL, or Azure Database, in the platform account or yoursPostgreSQL, MySQLnexus managed-db --provider<strong>Connected external database</strong>A database you already run elsewhere, connected for schema inspection, guarded queries, and AI fix proposalsPostgreSQL, MySQLDashboard and MCP</p><p>All four sit behind the same organization, the same role-based permissions, and the same tools.</p><h3>Where to use each option</h3><h3>App database service: for prototypes and single apps</h3><p>Add a database when you deploy, and NEXUS AI runs it next to your app and injects the connection settings:</p><pre>nexus deploy source --repo https://github.com/your-org/helpdesk --services postgres,redis</pre><p>Use it when one app owns its data: a prototype, an internal tool, a side project, or the first version of a product. It is the fastest path from “generated code” to “working app with real data”.</p><p>Each service gets backups you control:</p><pre>nexus db services helpdesk                               # find the service ID<br>nexus db backup &lt;service-id&gt;                             # back up now<br>nexus db backup-schedule &lt;service-id&gt; --enable --retention 14   # daily, keep 14 days</pre><h3>Managed database on NEXUS AI: for data shared by several apps</h3><p>When two apps need the same data (an API and a worker, or an app and its admin panel), the database should not belong to either one. Create it on its own:</p><pre>nexus managed-db create orders-db --local --engine postgres<br>nexus managed-db attach orders-db --deployment orders-api<br>nexus managed-db attach orders-db --deployment orders-worker</pre><p>Each app receives DATABASE_URL (or REDIS_URL for Redis) on its next deploy. Use --env-prefix to give a second database a different name, such as ANALYTICS_URL. Deleting an app no longer puts the data at risk, because the database has its own lifecycle.</p><p>Managed databases on NEXUS AI listen on the primary host’s private Docker network, so they attach to apps deployed on NEXUS AI on that host.</p><h3>Managed cloud database: for production and compliance</h3><p>When the data needs a cloud provider’s durability, encryption, and controls, create the database on Amazon RDS, Google Cloud SQL, or Azure Database for PostgreSQL and MySQL:</p><pre>nexus managed-db create billing-db --provider AWS_RDS --engine postgres \<br>  --engine-version 17.10 --instance-class db.t3.micro --allocated-gb 20 --region us-east-1</pre><p>Or let the deploy create it for you. On a cloud provider, --create-db provisions a managed database paired with the app:</p><pre>nexus deploy source --repo https://github.com/your-org/billing --provider aws_app_runner --create-db postgres</pre><p>Amazon RDS instances are created with storage encryption and seven days of automated backups. On AWS you can choose --network-mode vpc to keep the database private, reachable only from App Runner apps in the same account.</p><p>If you have added your own cloud credentials in Deployment Providers, new cloud databases are created in <strong>your</strong> AWS account or Azure subscription, not the platform’s. See <a href="https://./bring-your-own-cloud-account-aws-azure-gcp.md">Bring Your Own Cloud Account</a>.</p><h3>Connected external database: for data you already have</h3><p>Not every database should move. Connect an existing PostgreSQL or MySQL database in the dashboard, then inspect its schema, preview queries, and get AI-proposed fixes from your app’s error logs, all with guardrails described below.</p><h3>Quick decision guide</h3><p>Your situationStart withPrototype or demo with real dataApp database serviceOne app, small team, needs backupsApp database service with a backup scheduleSeveral apps share the same dataManaged database on NEXUS AIProduction workload, customer data, uptime commitmentsManaged cloud databaseCompliance requires data in your own accountManaged cloud database with your own cloud providerData already lives somewhere elseConnected external database</p><h3>The management point of view</h3><p>For the person responsible for the platform, databases are usually where tools sprawl: one console per cloud, scripts for backups, and a wiki page about who has the passwords. NEXUS AI keeps them in one place.</p><p><strong>One inventory.</strong> Every database in the organization, whichever option and provider, appears in the dashboard and in nexus managed-db list and nexus db services.</p><p><strong>Permissions by role.</strong> Reading data and changing it are separate permissions. A teammate with read access can run SELECT queries; write and schema-changing queries require the managed_databases.manage permission. Assign roles per person, and use scoped access tokens for CI.</p><p><strong>Backups with a floor.</strong> Scheduled backups keep at least 7 days of history, and retention can be raised but never lowered below that. Expired automatic backups are pruned on schedule; backups you upload are never deleted automatically.</p><p><strong>Recovery that does not overwrite.</strong> Managed database restores always create a new database from a snapshot:</p><pre>nexus managed-db snapshot orders-db --notes &quot;before v2 migration&quot;<br>nexus managed-db restore orders-db --snapshot &lt;snapshot-id&gt; --new-name orders-db-check</pre><p>You compare the restored copy with the original before you switch anything.</p><p><strong>Safe sharing of backups.</strong> Instead of handing out credentials, create a signed download link that expires in 30 to 3,600 seconds:</p><pre>nexus db backup-download &lt;service-id&gt; &lt;backup-id&gt; --share --ttl 900</pre><p><strong>Plan limits you can predict.</strong></p><p>PlanStandalone managed databasesFreeApp database services onlyStarter2Pro10EnterpriseUnlimited</p><h3>Portability: your data is never trapped</h3><p>A database platform is only as good as your ability to leave it. NEXUS AI is built on that assumption.</p><p><strong>Standard engines, no proprietary layer.</strong> PostgreSQL, MySQL, MongoDB, and Redis run as themselves. Your app connects with its normal driver and a normal connection URL. No SDK, no special query language.</p><p><strong>Backups in native formats.</strong> PostgreSQL backups use pg_dump, MySQL uses mysqldump, and MongoDB uses mongodump. Download any backup and restore it with standard tools on any server:</p><pre>nexus db backup-download &lt;service-id&gt; &lt;backup-id&gt; --out ./prod.dump<br>pg_restore -d &quot;$TARGET_DATABASE_URL&quot; --no-owner ./prod.dump</pre><p><strong>Move data between services.</strong> Copy production into staging without leaving the platform, as long as both use the same engine:</p><pre>nexus db restore-to &lt;staging-service-id&gt; &lt;backup-id&gt; --yes</pre><p>Or bring data in from outside with nexus db backup-upload.</p><p><strong>Connection settings, not code changes.</strong> Apps read their database from environment variables. Detach one database and attach another, redeploy, and the app follows. Moving from a database on NEXUS AI to Amazon RDS is a data copy and an attach, not a rewrite.</p><p><strong>Your cloud account, your resources.</strong> Cloud databases created with your own provider credentials live in your account. If you stop using NEXUS AI, they keep running where they are.</p><h3>Flexibility: one workflow, many shapes</h3><ul><li><strong>Four engines</strong> for different jobs: relational data in PostgreSQL or MySQL, documents in MongoDB, caches and queues in Redis.</li><li><strong>Four homes</strong> for standalone databases: NEXUS AI, Amazon RDS, Google Cloud SQL, and Azure Database.</li><li><strong>Public or private networking</strong> on AWS: public endpoints restricted to allowed address ranges, or VPC mode with no public endpoint.</li><li><strong>Several databases per app</strong>, each under its own environment variable prefix.</li><li><strong>Three ways in</strong>: the dashboard for people, the CLI for scripts and CI, and the MCP server for AI assistants.</li></ul><h3>Who it is for</h3><p><strong>Founders and solo builders</strong> who generated an app with AI and need real data, backups, and a URL today, without learning a cloud console.</p><p><strong>Product and agency teams</strong> shipping many small apps, who need each one to have a database that is backed up, separated, and easy to hand over.</p><p><strong>Platform and DevOps leads</strong> who want one inventory, consistent backups, and role-based access across every database their teams create.</p><p><strong>Regulated and enterprise teams</strong> who need the data in their own cloud account, encrypted, with their own audit trail, while developers keep a simple workflow.</p><h3>Why NEXUS AI is a strong fit for AI deployments</h3><p>AI changes who touches the database. An agent in Claude, Cursor, or Codex can now create a schema, write a migration, and run it, often faster than a person can review it. That is useful, and it needs guardrails that do not depend on the agent behaving perfectly.</p><p><strong>AI assistants get real database tools.</strong> The NEXUS AI MCP server exposes database operations directly to AI assistants: listing services, taking and restoring backups, creating and attaching managed databases, taking snapshots, inspecting schemas, and running queries. An agent can deploy an app with a database and back it up before a migration in the same conversation.</p><p><strong>Every query is classified before it runs.</strong> Queries are sorted into reads, data changes, schema changes, and blocked operations. Statements such as DROP DATABASE, role changes, extension installs, and server file access are refused outright.</p><p><strong>Preview before execute.</strong> On connected databases, a preview runs read queries with EXPLAIN and does not apply changes, so the agent (and you) can see what a statement would do first. Execution runs with a statement timeout and returns at most 1,000 rows by default.</p><p><strong>Permissions apply to agents too.</strong> An assistant acts with the permissions of the person or token it uses. Give an agent a read-only role and it cannot change data, whatever it is asked to do.</p><p><strong>Fixes are proposals, not surprises.</strong> NEXUS AI can read an app’s error logs and propose a schema fix, such as a missing column or index. The fix is stored as a proposal and is applied only when someone applies it.</p><p><strong>Backups are one command away from any agent.</strong> The habit that saves teams most often is simple: snapshot before a migration. With MCP, asking the agent to “take a snapshot first” is all it takes, and restores never overwrite the original.</p><p><strong>The database follows the app’s lifecycle.</strong> AI-built apps change quickly: prototype on Monday, shared with a team on Wednesday, in production the next month. The path from app database service to managed database to your own cloud account uses the same commands and the same connection variables at every step.</p><h3>What to know before you start</h3><ul><li>Managed databases on NEXUS AI support PostgreSQL and Redis; use a cloud provider for managed MySQL.</li><li>Managed databases on NEXUS AI attach only to apps running on the NEXUS AI primary host.</li><li>Private (VPC) cloud databases must be in the same cloud account as the app that uses them.</li><li>App database service restores replace the current data in place. Take a fresh backup first if you may want the current state back.</li><li>restore-to requires the source and target to use the same engine.</li></ul><h3>Frequently asked questions</h3><h3>What databases does NEXUS AI support?</h3><p>PostgreSQL, MySQL, MongoDB, and Redis as app database services. PostgreSQL and Redis as managed databases on NEXUS AI. PostgreSQL and MySQL as managed cloud databases on Amazon RDS, Google Cloud SQL, and Azure Database.</p><h3>Can I export my data and leave?</h3><p>Yes. Backups use the engines’ native dump formats, so you can download them and restore them anywhere with standard tools. Cloud databases created with your own credentials are already in your account.</p><h3>Is it safe to let an AI agent run queries?</h3><p>NEXUS AI classifies every query, blocks dangerous statements, separates read and write permissions, and offers a preview mode. Give agents the least access they need, and ask them to snapshot before migrations.</p><h3>What is the difference between nexus db and nexus managed-db?</h3><p>nexus db manages databases that run alongside one app, created with --services. nexus managed-db manages standalone databases that you create once and attach to any number of apps.</p><h3>Can I move from a database on NEXUS AI to Amazon RDS later?</h3><p>Yes. Create the RDS database, copy the data with a backup and restore, attach the new database to the app, and redeploy. The app keeps reading DATABASE_URL.</p><h3>How long are backups kept?</h3><p>Scheduled backups are kept for 7 days by default, and you can raise retention per service. Backups you upload are kept until you delete them.</p><h3>Start with the database your app needs today</h3><p>Deploy your next app with --services postgres, turn on a backup schedule, and connect your AI assistant to NEXUS AI through MCP. When the data outgrows one app, create a managed database and attach it. When it needs a cloud provider or your own account, move it there with the same tools.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72be8c6819be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Virtual Models: One Model Name, Any Model Behind It]]></title>
            <link>https://medium.com/@sali_13462/virtual-models-one-model-name-any-model-behind-it-0af06bd7a5d5?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0af06bd7a5d5</guid>
            <category><![CDATA[ai-caching-strategies]]></category>
            <category><![CDATA[ai-model]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[virtual-model]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 18:53:17 GMT</pubDate>
            <atom:updated>2026-10-26T18:53:17.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1z2F-MuB9vf4Uyv9-iZhFg.png" /></figure><h3>Virtual Models: One Model Name, Any Model Behind It</h3><p>A new model ships almost every week. One is cheaper, one is faster, one finally handles your hardest coding task. Taking advantage of it should be a five-minute decision. In most stacks it is a small project: change an environment variable in three services, update a provider SDK, add a new API key, redeploy, and hope nothing else breaks.</p><p>Virtual models remove that work. This article explains what a virtual model is, when to use one, why it fits the way AI agents and apps are built today, and how to route different jobs to different models using the routing strategies in <a href="https://zrouter.si/">ZRouter</a>, an open source, OpenAI-compatible AI gateway.</p><h3>What is a virtual model?</h3><p>A virtual model is a model name you define, plus a rule for what that name means.</p><p>Your application sends the name in the normal model field:</p><pre>{ &quot;model&quot;: &quot;assistant&quot;, &quot;messages&quot;: [{ &quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Hi&quot; }] }</pre><p>The gateway reads assistant, looks up its rule, and decides which real provider model serves the request. The rule can be as simple as &quot;assistant means anthropic/claude-sonnet-4-6&quot; or as rich as &quot;send easy prompts to a cheap model, hard prompts to a strong one, and fail over to a second provider if the first is down&quot;.</p><p>Your app never learns which model answered unless you want it to. It only knows the name.</p><p>In ZRouter, a virtual model comes in two forms:</p><ul><li><strong>Redirect (alias).</strong> A name that points at one or more real models. This is what most of this article is about.</li><li><strong>Access policy.</strong> A rule with no target that restricts who can use an existing model, by user path, or disables it.</li></ul><p>You create them in the dashboard (<strong>Models → New virtual model</strong>), in config.yaml, through the VIRTUAL_MODELS environment variable, or through the admin API. When prepaid billing is enabled, customers can also create private virtual models in their own dashboard.</p><h3>The problem it solves: model choice is wired into your code</h3><p>Without a gateway, the model is usually decided in three places at once:</p><ol><li><strong>The endpoint.</strong> Each provider has its own base URL.</li><li><strong>The credentials.</strong> Each provider has its own API key, stored in each app’s environment.</li><li><strong>The model ID.</strong> A string like gpt-4o-2024-08-06 hardcoded or set in an environment variable.</li></ol><p>Changing models means changing one or all of these, in every service that calls the model. For a single chatbot that is annoying. For a company with ten apps and twenty agents it is a migration.</p><p>With a gateway and virtual models, all three are fixed:</p><ul><li><strong>One endpoint:</strong> https://zrouter.si/v1 (or your self-hosted gateway), for every provider.</li><li><strong>One key:</strong> your gateway key. Provider keys live in the gateway, not in each app.</li><li><strong>One stable model name:</strong> assistant, coder, summarizer, whatever you choose.</li></ul><pre>from openai import OpenAI</pre><pre>client = OpenAI(base_url=&quot;https://zrouter.si/v1&quot;, api_key=ZROUTER_API_KEY)</pre><pre>reply = client.chat.completions.create(<br>    model=&quot;coder&quot;,<br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Refactor this function...&quot;}],<br>)</pre><p>Switching coder from one model to another is an edit in the gateway. No environment variable changes, no new endpoint, no redeploy, no restart of the agent. The next request simply goes to the new model.</p><h3>Why virtual models fit today’s AI agents and apps</h3><h3>Models change faster than release cycles</h3><p>Frontier models are updated, renamed, repriced, and deprecated on a monthly rhythm. If every model change needs a code release, you either fall behind or spend your team’s time on plumbing. A virtual model turns “upgrade the model” into a configuration change you can make and undo in seconds.</p><h3>Agents call models from many places</h3><p>A modern agent is not one model call. It plans, writes code, calls tools, summarizes results, checks its own work, and often runs sub-agents. Each step has a different ideal model. Hardcoding a model ID in each step spreads model decisions across your codebase. Naming each step by its job (planner, coder, reviewer, summarizer) keeps the agent code about the job, and moves the model decision to the gateway.</p><h3>Many tools only let you set one model</h3><p>Coding agents and AI apps such as Claude Code, Codex, Cursor, OpenCode, OpenWebUI, LibreChat, and n8n let you set a base URL and a model name, and nothing more. A virtual model lets that single name carry routing logic, failover, cost control, and guardrails the tool itself knows nothing about.</p><h3>Reliability needs more than one provider</h3><p>Providers have outages and rate limits. A virtual model with several targets keeps serving as long as one target is available, without the app writing retry logic for each provider.</p><h3>Cost needs to follow the task</h3><p>Sending every request to the strongest model is expensive. Sending every request to the cheapest model hurts quality. Routing by task, time of day, or request difficulty lets you pay for capability only where it matters.</p><h3>Teams need governance in one place</h3><p>Who can use which model, which guardrails apply, and how much they can spend are platform decisions. Putting them on the virtual model means every app that uses the name gets the same policy.</p><h3>When to use a virtual model</h3><p>Use one when any of these is true:</p><ul><li>You expect to <strong>change or upgrade</strong> the model behind a feature.</li><li>More than one app or agent step <strong>shares a model decision</strong>.</li><li>You want <strong>failover</strong> to a second model or provider.</li><li>You want to <strong>balance load or cost</strong> across several models.</li><li>You want different models for <strong>different jobs</strong> behind a clear name.</li><li>You want to <strong>A/B test</strong> a model without touching the app.</li><li>You need to <strong>limit access</strong> to a model for certain users or teams.</li><li>You want <strong>guardrails</strong> to apply to everything that calls a model name.</li></ul><p>When should you skip it? If one script calls one model and you have no routing, failover, or access needs, call the provider model ID directly. ZRouter accepts both, so you can add a virtual model later without changing anything else.</p><h3>Route by job: name models after what they do</h3><p>The most useful habit with virtual models is naming them after the <strong>job</strong>, not the model. Here is a typical agent setup:</p><p>Virtual modelJobGood fitplannerBreak a task into steps, reason about trade-offsStrongest reasoning modelcoderWrite and edit codeBest coding model, with failoverfastClassify, extract, route, short answersSmall, cheap, low-latency modelsummarizerCondense logs, documents, tool outputCheap model with long contextreviewerCheck output, judge qualityA different model family from coderautoGeneral chat where difficulty variesDifficulty-based routing</p><p>The agent code calls planner for planning and fast for classification. When a better coding model ships, you repoint coder and every agent improves at once. When summarizer is costing too much, you swap it for a cheaper model and watch quality, all without a deploy.</p><p>Each of these names can use a different routing strategy. That is where the real power is.</p><h3>Routing strategies, and what each is best for</h3><p>A ZRouter redirect can have several targets and a <strong>strategy</strong> that decides which target serves each request. Every strategy shares three behaviors:</p><ul><li><strong>Unavailable targets are skipped.</strong> An unknown model or a provider that is down does not break the name.</li><li><strong>The other targets form a failover chain.</strong> If the chosen target fails with a retryable error, ZRouter tries the remaining available targets in order. You can turn this off per virtual model.</li><li><strong>Session keeping is on by default.</strong> Requests from one detected client session (for example one Claude Code or Codex session) stay on the same target, so provider prompt caches stay warm and behavior stays consistent mid-conversation. The failover strategy ignores this setting because it always uses the first available target anyway.</li></ul><h3>1. Single target (alias)</h3><p><strong>What it does:</strong> One name, one model.</p><p><strong>Best for:</strong> Stable names for apps, hiding provider IDs, and making future upgrades a one-line change. Start here for every job, and add targets when you need them.</p><pre>virtual_models:<br>  - source: summarizer<br>    target: openai/gpt-4o-mini</pre><h3>2. Round-robin (default)</h3><p><strong>What it does:</strong> Rotates requests across targets. Weights bias the share: a target with weight 2 gets twice the traffic of a target with weight 1.</p><p><strong>Best for:</strong></p><ul><li>Spreading load across providers to stay under rate limits.</li><li>Gradual migrations and canaries: send 10% of traffic to a new model with weights 9 and 1, then shift.</li><li>Comparing models on real traffic.</li></ul><pre>- source: coder<br>    strategy: round_robin<br>    targets:<br>      - { model: anthropic/claude-sonnet-4-6, weight: 9 }<br>      - { model: openai/gpt-5, weight: 1 }</pre><h3>3. Lowest cost</h3><p><strong>What it does:</strong> Sends every request to the cheapest currently available target, using catalog input plus output prices. Targets without pricing are skipped while a priced target exists.</p><p><strong>Best for:</strong> High-volume jobs where several models are good enough and price is the deciding factor: classification, extraction, tagging, routine summaries. If the cheapest provider goes down, the next cheapest takes over automatically.</p><pre>- source: fast<br>    strategy: cost<br>    targets:<br>      - { model: openai/gpt-4o-mini }<br>      - { model: groq/llama-3.3-70b }<br>      - { model: anthropic/claude-haiku-4-5 }</pre><h3>4. Failover</h3><p><strong>What it does:</strong> Always uses the first available target in the list. Lower entries only serve when everything above them is unavailable or fails.</p><p><strong>Best for:</strong> Production features where you have a clear preferred model and want backups only for emergencies. Customer-facing chat, critical agent steps, and anything where consistency matters more than spreading load.</p><pre>- source: planner<br>    strategy: failover<br>    targets:<br>      - { model: anthropic/claude-opus-4-6 }<br>      - { model: openai/gpt-5 }<br>      - { model: anthropic/claude-sonnet-4-6 }</pre><h3>5. Schedule (time of day)</h3><p><strong>What it does:</strong> Uses one set of targets during a daily peak window and another set off-peak, in a timezone you choose.</p><p><strong>Best for:</strong></p><ul><li>Paying for speed when users are waiting (business hours) and saving money when they are not.</li><li>Overnight batch jobs, evals, and background agents that can run on a cheaper model.</li><li>Moving traffic away from a provider that is congested at certain hours.</li></ul><pre>- source: assistant<br>    strategy: schedule<br>    targets:<br>      - model: openai/gpt-4o<br>      - model: groq/llama-3.3-70b<br>    strategy_config:<br>      timezone: America/New_York<br>      peak_start: &quot;08:00&quot;<br>      peak_end: &quot;18:00&quot;<br>      peak_targets: [openai/gpt-4o, groq/llama-3.3-70b]<br>      off_peak_targets: [groq/llama-3.3-70b]</pre><p>Set the timezone to where your users are, not where the server runs. Windows that wrap midnight work too.</p><h3>6. Super Intelligence Router (request difficulty)</h3><p><strong>What it does:</strong> Scores every request from 0 to 100 using signals in the request itself: prompt length, code, reasoning words, math, tools, images, conversation length, and requested reasoning effort. The score picks a tier: <strong>simple</strong> (below 25), <strong>standard</strong> (25 to 54), or <strong>complex</strong> (55 and above). The request goes to the first available target in that tier. Scoring adds well under a millisecond.</p><p><strong>Best for:</strong> General-purpose names like auto where users and agents send a mix of easy and hard work. Greetings and rewrites go to a cheap model, debugging sessions with tools go to your strongest model. A hard request is never downgraded while a strong model is up: if its tier is empty or down, ZRouter tries stronger tiers first.</p><pre>- source: auto<br>    strategy: super_intelligence<br>    targets:<br>      - model: groq/llama-3.3-70b<br>      - model: openai/gpt-4o-mini<br>      - model: anthropic/claude-sonnet-4-5<br>    strategy_config:<br>      simple_targets: [groq/llama-3.3-70b]<br>      standard_targets: [openai/gpt-4o-mini]<br>      complex_targets: [anthropic/claude-sonnet-4-5]</pre><p>Every response explains the decision, which makes tuning easy:</p><pre>X-ZRouter-Route: super_intelligence; tier=complex; score=63; reasons=code,tools,reasoning-cues</pre><h3>7. Adaptive (ZRouter Pro)</h3><p><strong>What it does:</strong> Picks the target with the best observed mix of latency, error rate, and price, backs off from targets that are rate limited or failing, and keeps a session on the provider whose prompt cache is warm.</p><p><strong>Best for:</strong> High-traffic production names where provider performance changes during the day and you want the gateway to react on its own. On an open source build this strategy falls back to round-robin.</p><h3>8. Plugin strategies</h3><p><strong>What it does:</strong> Hands the choice to a routing plugin. ZRouter ships one, cheapest_healthy, which prefers the cheapest (or fastest) target whose recent error rate is acceptable. You can also write your own.</p><p><strong>Best for:</strong> Cost-sensitive jobs that also need to avoid flaky providers, and teams with custom routing rules (data residency, customer tiers, internal model servers). If the plugin is missing, errors, or takes longer than 250 ms, the redirect falls back to weighted round-robin, so a broken plugin does not take the name down.</p><pre>- source: smart-router<br>    strategy: plugin<br>    strategy_plugin: cheapest_healthy<br>    strategy_config:<br>      prefer: cheapest     # or: fastest<br>      max_error_rate: 0.2<br>    targets:<br>      - openai/gpt-4o-mini<br>      - anthropic/claude-haiku-4-5</pre><h3>Choosing a strategy</h3><p>If the job needs…UseA stable name and easy upgradesSingle targetLoad spread, canaries, gradual migrationRound-robin with weightsThe lowest price among good-enough modelsLowest costOne preferred model with emergency backupsFailoverSpeed by day, savings by nightScheduleOne name for mixed easy and hard workSuper Intelligence RouterAutomatic tuning on live performanceAdaptive (Pro)Cheapest model that is also healthy, or custom rulesPlugin (cheapest_healthy or your own)</p><h3>Combine strategies by chaining virtual models</h3><p>A target can be another virtual model. This lets you build routing in layers instead of one complicated rule.</p><pre>virtual_models:<br>  # A cheap pool, balanced across two providers.<br>  - source: cheap<br>    targets:<br>      - { model: openai/gpt-4o-mini }<br>      - { model: groq/llama-3.3-70b }</pre><pre>  # A premium model with a backup.<br>  - source: premium<br>    strategy: failover<br>    targets:<br>      - { model: anthropic/claude-sonnet-4-6 }<br>      - { model: openai/gpt-5 }</pre><pre>  # Difficulty routing on top of both pools.<br>  - source: auto<br>    strategy: super_intelligence<br>    targets:<br>      - { model: cheap }<br>      - { model: premium }<br>    strategy_config:<br>      simple_targets: [cheap]<br>      complex_targets: [premium]</pre><p>Now auto sends easy work to a balanced cheap pool and hard work to a premium model with failover. Change cheap once, and every name that uses it follows. Chains are checked for cycles and can be up to 8 levels deep. Session keeping applies at every level, so a session stays on one concrete model.</p><h3>More things a virtual model can carry</h3><p>Routing is the main use, but the same name can hold other policies:</p><ul><li><strong>Shadowing.</strong> Give a virtual model the same name as a real model, such as anthropic/claude-opus-4-6, and point it somewhere else. Apps that hardcode that ID get the new model without a code change. This is useful for emergency swaps and for testing whether a cheaper model handles an existing flow.</li><li><strong>Access control.</strong> Limit a name to certain user paths (teams or customer accounts), or disable it.</li><li><strong>Guardrails.</strong> Attach up to 16 guardrails that run on every request to that name, such as PII redaction or blocked terms. Every app and agent that uses the name is covered.</li><li><strong>Promotions.</strong> Publish a model for a limited time with per-user and total request and token caps, for launches and free trials.</li><li><strong>Slowdown.</strong> Add artificial latency to test how your app behaves with a slower model before you switch.</li><li><strong>Model list control.</strong> Set KEEP_ONLY_ALIASES_AT_MODELS_ENDPOINT=true so /v1/models lists only your curated names instead of every provider model.</li></ul><h3>A practical rollout plan</h3><ol><li><strong>Name your jobs.</strong> List the places your apps and agents call a model and give each job a name: assistant, coder, fast, summarizer.</li><li><strong>Start with single targets.</strong> Create each name pointing at the model you use today. Point your apps at the gateway URL and switch the model field to the new names. Behavior is unchanged.</li><li><strong>Add failover to critical names.</strong> Add a second provider to anything customer-facing.</li><li><strong>Optimize cost where quality allows.</strong> Move high-volume jobs to lowest cost, or put a general auto name on the Super Intelligence Router.</li><li><strong>Experiment safely.</strong> Use weighted round-robin to try new models on a small share of traffic, and compare usage, latency, and quality in the dashboard.</li><li><strong>Keep the names, change the models.</strong> From now on, model upgrades are edits in the gateway.</li></ol><h3>Key takeaways</h3><ul><li>A virtual model is a stable name that the gateway resolves to a real model at request time.</li><li>Your app keeps one endpoint, one key, and one model name. Switching models never means updating environment variables or reconfiguring endpoints.</li><li>Name virtual models after jobs, then give each job the routing strategy that fits it.</li><li>Round-robin spreads load, lowest cost saves money, failover protects critical paths, schedule follows the clock, the Super Intelligence Router follows request difficulty, adaptive follows live performance, and plugins cover everything else.</li><li>Chain virtual models to combine strategies, and attach guardrails and access rules so every caller gets the same policy.</li></ul><p><a href="https://zrouter.si/">ZRouter</a> is open source under the MIT license and speaks the OpenAI API. Point any existing client at https://zrouter.si/v1, create your first virtual model, and your next model upgrade will be a configuration change instead of a release.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0af06bd7a5d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Where to Put Your AI Cache: Client, Gateway, or Provider]]></title>
            <link>https://medium.com/@sali_13462/where-to-put-your-ai-cache-client-gateway-or-provider-f6fa7ac8bd07?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6fa7ac8bd07</guid>
            <category><![CDATA[ai-caching]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-model]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 18:17:54 GMT</pubDate>
            <atom:updated>2026-10-26T18:17:54.368Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m7r0BNNRe2uE-JSfNEIekQ.png" /></figure><p>There are three places: inside your application, at an AI gateway between your apps and the providers, and at the provider itself. Each has a role. This post compares them and then walks through a complete setup using <a href="https://zrouter.si/">ZRouter</a>, an open source AI gateway that runs every caching layer in one place.</p><h3>Option 1: Cache in the application</h3><p>You add a cache library or a Redis call around your LLM client code.</p><p><strong>Good for:</strong></p><ul><li>A single app with a narrow use case, such as caching one expensive summary per document.</li><li>Business-level caching, where you know something the model call does not. For example, “this product description is unchanged, so reuse yesterday’s summary.”</li></ul><p><strong>Weak at:</strong></p><ul><li><strong>Duplication.</strong> Every service, language, and team writes its own cache with its own bugs.</li><li><strong>Correctness details.</strong> Key design, streaming replay, request coalescing, tenant isolation, and invalidation on policy changes are easy to get subtly wrong.</li><li><strong>Provider prompt caching.</strong> Each provider has its own directives. Your app code ends up full of provider-specific fields that break when you switch models.</li><li><strong>Visibility.</strong> Hit rates are scattered across services.</li></ul><h3>Option 2: Cache at the provider</h3><p>Provider prompt caching runs on the provider’s servers. You mostly need to structure prompts well and, for some providers, send a directive.</p><p><strong>Good for:</strong></p><ul><li>Long, stable prefixes. It is the only layer that can reuse the model’s own processing.</li><li>Keeping every answer fresh.</li></ul><p><strong>Weak at:</strong></p><ul><li>It never skips the call. You still pay for output and for the new part of the input.</li><li>Every provider works differently: automatic caching, cache keys, breakpoints, or explicit cached-content objects with their own lifetimes.</li><li>It depends on routing. Spreading one conversation across providers, models, or API keys can leave the cache cold.</li></ul><h3>Option 3: Cache at the gateway</h3><p>An AI gateway is a proxy that sits between your applications and model providers. All LLM traffic passes through it, which makes it the natural home for shared concerns: routing, failover, budgets, guardrails, logging, and caching.</p><p><strong>Good for:</strong></p><ul><li><strong>One cache for every app.</strong> Any client that speaks the OpenAI API benefits without code changes.</li><li><strong>Correct keys.</strong> The gateway knows the authenticated tenant, the resolved provider and model, and which policies ran, so it can key on all of them.</li><li><strong>Provider prompt caching without provider code.</strong> The gateway knows the final provider after routing and can add the right directive for it.</li><li><strong>Routing that respects caches.</strong> The gateway can keep a session on the same target and key so provider caches stay warm.</li><li><strong>One place to measure.</strong> Hit rates and cost avoided appear in one dashboard.</li></ul><p><strong>Weak at:</strong></p><ul><li>Business-level knowledge that only your app has. Keep that in the app.</li></ul><h3>The recommended layout</h3><p>For most teams the answer is a combination:</p><ol><li><strong>Gateway:</strong> exact cache, semantic cache where it fits, prompt-cache planning, and session stickiness.</li><li><strong>Provider:</strong> prompt caching, driven by the gateway.</li><li><strong>Application:</strong> only domain-specific caching, plus stable prompt structure (static content first).</li></ol><h3>Setting it up in ZRouter</h3><p>The examples below show configuration only. Keep real API keys and connection strings in your secret manager or environment, never in committed files.</p><h3>Step 1: Provider prompt caching (already on)</h3><p>ZRouter’s provider prompt-cache planner is enabled by default. To make that explicit in your deployment:</p><pre>PROVIDER_PROMPT_CACHE_PLANNER_ENABLED=true</pre><p>For Gemini, you can tune the lifetime of the cached-content objects ZRouter creates. The default is 300 seconds, and values from 30 to 3600 are accepted:</p><pre>GEMINI_PROMPT_CACHE_TTL_SECONDS=300</pre><p>If your client already sends its own cache directives (for example Anthropic cache_control blocks), ZRouter passes them through unchanged. To turn off automatic planning but keep pass-through, set the flag to false.</p><h3>Step 2: Exact response cache</h3><p>Point ZRouter at Redis in config.yaml:</p><pre>cache:<br>  response:<br>    simple:<br>      redis:<br>        url: redis://localhost:6379<br>        ttl: 3600</pre><p>Or with environment variables only:</p><pre>RESPONSE_CACHE_SIMPLE_ENABLED=true<br>REDIS_URL=redis://localhost:6379<br>REDIS_TTL_RESPONSES=3600</pre><h3>Step 3: Semantic cache (optional)</h3><p>Add an embedder and a vector store. Qdrant is shown here. pgvector, Pinecone, and Weaviate are also supported.</p><pre>cache:<br>  response:<br>    semantic:<br>      enabled: true<br>      embedder:<br>        provider: openai<br>        model: text-embedding-3-small<br>      vector_store:<br>        type: qdrant<br>        qdrant:<br>          url: http://localhost:6333<br>          collection: aigateway_semantic</pre><p>Useful tuning variables:</p><pre>SEMANTIC_CACHE_THRESHOLD=0.92            # similarity required for a hit<br>SEMANTIC_CACHE_TTL=3600                  # seconds an entry lives<br>SEMANTIC_CACHE_MAX_CONV_MESSAGES=3       # recent conversation included in the key<br>SEMANTIC_CACHE_EXCLUDE_SYSTEM_PROMPT=false</pre><p>If you use pgvector or Pinecone, make sure the configured dimension matches your embedding model’s output size (1536 for text-embedding-3-small).</p><p>When both layers are enabled, a semantic hit is also remembered in Redis for that exact request. The next identical request skips the embedding and the vector search and is still reported as HIT (semantic).</p><h3>Step 4: Send traffic and check the headers</h3><p>Any OpenAI-compatible client works. Send the same request twice:</p><pre>curl -i https://your-gateway/v1/chat/completions \<br>  -H &quot;Authorization: Bearer $ZROUTER_API_KEY&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;model&quot;:&quot;openai/gpt-4o-mini&quot;,&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;What are your API rate limits?&quot;}]}&#39;</pre><p>The second response includes:</p><pre>X-Cache: HIT (exact)</pre><p>A paraphrased question, with the semantic layer enabled, can return X-Cache: HIT (semantic).</p><h3>Step 5: Bypass when you need fresh output</h3><p>For “regenerate” buttons, live data, or debugging, skip both response cache layers for one request:</p><pre>-H &quot;Cache-Control: no-cache&quot;</pre><p>Use no-store when the response should not be written to the cache either.</p><h3>Step 6: Keep sessions sticky for agents</h3><p>If you run coding agents through ZRouter, session keeping works with zero configuration. Known session headers such as X-Session-Id, X-Claude-Code-Session-Id, and Codex&#39;s Session-Id keep a session on the same load-balanced target and the same provider key, so provider prompt caches stay warm for the whole task.</p><h3>Step 7: Measure</h3><p>Cache hits are recorded as usage entries with cache_type set to exact or semantic:</p><pre># Hits only, for one team<br>curl &quot;https://your-gateway/admin/usage/summary?user_path=/team/alpha&amp;cache_mode=cached&quot; \<br>  -H &quot;Authorization: Bearer $AIGATEWAY_MASTER_KEY&quot;</pre><p>Use /admin/cache/overview for a cache-only summary. Default usage reports exclude hits, so cost totals keep matching your provider invoice.</p><h3>What ZRouter handles so you do not have to</h3><p>A quick checklist of the details covered in Part 3, and how the gateway deals with them:</p><p>ConcernHow ZRouter handles itTenant isolationKeys include the auth scope and account-bound user pathParameter changesExact keys include the final body and resolved model; semantic keys include all request optionsPolicy changesThe guardrail chain is part of the exact cache keyFormatting differencesJSON is canonicalized before hashingTraffic spikesConcurrent identical misses are coalesced per processStreamingRaw event streams are stored and replayedFailover answersNot cached under the primary’s keyBYOK trafficBypasses the shared response cacheProvider differencesOne planner adds the right prompt-cache directive per provider</p><h3>Wrapping up the series</h3><p>AI caching is one of the few optimizations that cuts cost and latency at the same time. The key ideas from all four parts:</p><ol><li><strong>Know the layers.</strong> Exact and semantic caches reuse answers. Prompt caching reuses the model’s reading of your prompt. Embedding caching reuses vectors.</li><li><strong>Measure the benefit.</strong> Track hit rate and cost avoided per layer.</li><li><strong>Match the layer to the workload.</strong> Response caches for repetitive, stable traffic. Prompt caching nearly everywhere, especially for agents.</li><li><strong>Put shared caching at the gateway.</strong> It sees every request, knows the tenant and the final model, and keeps provider caches warm.</li></ol><p>If you want to try it, <a href="https://zrouter.si/">ZRouter</a> is open source under the MIT license and speaks the OpenAI API, so you can point an existing client at it and turn on each layer one step at a time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6fa7ac8bd07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When to Use AI Caching, and When Not To]]></title>
            <link>https://medium.com/@sali_13462/when-to-use-ai-caching-and-when-not-to-62f090553b19?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/62f090553b19</guid>
            <category><![CDATA[ai-model]]></category>
            <category><![CDATA[ai-caching-strategies]]></category>
            <category><![CDATA[ai-caching]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 13:41:47 GMT</pubDate>
            <atom:updated>2026-10-24T13:41:47.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxrtNuMMBE6AaD6KN35CEw.png" /></figure><h3>When to Use AI Caching, and When Not To</h3><p>We start with a simple test, go workload by workload, then cover the pitfalls. Examples refer to</p><p><a href="https://zrouter.si/">ZRouter</a></p><p>settings where it helps to be concrete.</p><h3>The three-question test</h3><p>Before enabling any response cache (exact or semantic), ask:</p><ol><li><strong>Do the same requests repeat?</strong> If most prompts are unique, a response cache will mostly miss.</li><li><strong>Is a reused answer still correct?</strong> If the right answer depends on time, live data, or the specific user, reuse is risky.</li><li><strong>Is a reused answer acceptable?</strong> Some products need variety (creative writing, brainstorming). Others need consistency (policy answers).</li></ol><p>If the answers are yes, yes, and yes, use a response cache. If any is no, skip response caching for that traffic and lean on provider prompt caching instead, which never reuses answers and is safe almost everywhere.</p><h3>Workload by workload</h3><p><strong>FAQ bots and support assistants</strong></p><p><strong>Use:</strong> exact cache, semantic cache, prompt caching.</p><p>This is the best case. Questions repeat constantly, answers are stable, and consistency is a feature. Start the semantic threshold high and lower it only when you have evidence. ZRouter’s default threshold is 0.92, which is a sensible starting point. Set a TTL that matches how often your underlying content changes. If your help center updates weekly, a one-hour TTL (ZRouter’s semantic default, SEMANTIC_CACHE_TTL=3600) is safe.</p><p><strong>Retrieval-augmented generation (RAG)</strong></p><p><strong>Use:</strong> exact cache, prompt caching, embedding caching. Semantic cache with care.</p><p>In RAG, the answer depends on the retrieved documents as much as on the question. An exact cache is safe because the retrieved context is part of the request body, so a document change produces a new key. A semantic cache that matches only on the question could return an answer built from old documents. ZRouter reduces this risk because only the final user message is matched by meaning, while the rest of the request, including injected context in other messages and a window of recent conversation (SEMANTIC_CACHE_MAX_CONV_MESSAGES, default 3), still has to match. Even so, keep TTLs short when your corpus changes often.</p><p>Embedding caching pays off when you re-index. Identical chunks hit the exact cache on /v1/embeddings instead of being billed again.</p><p><strong>Coding agents and multi-step agents</strong></p><p><strong>Use:</strong> prompt caching. Avoid response caching.</p><p>Agents send long, stable prefixes (instructions, tool schemas, file contents) followed by new, specific steps. Each response must reflect the latest state of the task, so a reused answer is almost always wrong. But the prefix is the perfect target for prompt caching, and on long sessions it is where most of the money goes.</p><p>Two things decide whether prompt caching actually hits:</p><ul><li><strong>Prefix stability.</strong> Put static content first and changing content last. A timestamp at the top of a system prompt breaks the cache on every request.</li><li><strong>Routing stability.</strong> The provider cache lives on a specific provider, model, and often API key. If your router load-balances turn 5 to a different target than turn 4, the cache is cold.</li></ul><p>ZRouter handles the second point with session keeping: requests in a detected session (for example from Claude Code, Codex CLI, or OpenCode session headers) stay on the same target and the same provider key.</p><p><strong>Chat apps with personal context</strong></p><p><strong>Use:</strong> prompt caching. Response caching only for non-personal requests.</p><p>If answers mention the user’s name, account, or history, a shared response cache is a data leak waiting to happen. Make sure any response cache is scoped per user or per account. ZRouter includes the authenticated access scope and the server-derived user path in every exact and semantic cache key. Customer API keys are bound to /accounts/ACCOUNT_ID, and client headers cannot override that binding, so two accounts never share cached answers, even for identical prompts.</p><p><strong>Batch and offline jobs</strong></p><p><strong>Use:</strong> exact cache.</p><p>Evaluation runs, classification over a dataset, and nightly summaries often re-run the same inputs after a crash or a code change. An exact cache makes reruns cheap. Since timing does not matter, consider a long TTL for the duration of the job.</p><p><strong>Creative and generative features</strong></p><p><strong>Avoid:</strong> response caching.</p><p>If users click “regenerate” to get a different poem, serving the same poem defeats the feature. Bypass the cache for those requests. In ZRouter, send Cache-Control: no-cache or Cache-Control: no-store on any request that should skip both response cache layers.</p><p>Real-time or time-sensitive answers</p><p><strong>Avoid:</strong> response caching, or use a very short TTL.</p><p>“What is the status of my order?”, “What is the BTC price?”, and “Is the API down?” need live data. Fresh tool calls and retrieval are the right answer here, and prompt caching can still reduce the cost of the static instructions.</p><h3>Quick reference</h3><pre>| Workload | Exact | Semantic | Prompt cache | Embedding cache |<br>|---|---|---|---|---|<br>| FAQ / support | Yes | Yes, high threshold | Yes | Optional |<br>| RAG | Yes | Careful, short TTL | Yes | Yes |<br>| Coding agents | Rarely useful | No | Yes, most value | No |<br>| Personal chat | Only if scoped | Only if scoped | Yes | No |<br>| Batch jobs | Yes | Rarely | Yes | Yes |<br>| Creative | No | No | Yes | No |<br>| Real-time data | No, or short TTL | No | Yes | No |</pre><p><strong>Pitfalls that cause wrong answers</strong></p><p><strong>Semantic thresholds that are too loose</strong></p><p>At a low threshold, “cancel my subscription” and “renew my subscription” can look similar. The cost of one wrong hit is usually higher than the savings from many right ones. Start strict, monitor wrong-hit reports, and loosen slowly.</p><p><strong>Ignoring parameters</strong></p><p>Two requests with the same prompt but different models, temperatures, tools, or response formats are different requests. A cache that keys only on the prompt text will serve a JSON-mode answer to a plain-text request. ZRouter’s semantic keys include all top-level request options and provider extensions, and its exact keys include the resolved provider and model, so a change in any of them is a miss.</p><p><strong>Caching across policy changes</strong></p><p>If you add a guardrail that redacts personal data, cached responses from before the change were never checked by it. ZRouter includes the resolved guardrail chain in the exact cache key. Editing, adding, or removing a guardrail step produces a miss rather than replaying a response the new policy never saw.</p><p><strong>Caching failures and fallbacks</strong></p><p>Never cache errors. Be careful about caching answers from a fallback model under the primary model’s key. ZRouter does not cache failed responses, and it does not cache responses served through failover.</p><p><strong>Leaking data between tenants</strong></p><p>The most serious pitfall. Any shared response cache must key on the tenant. If you run multi-tenant infrastructure, verify this before enabling caching, not after. Also check how bring-your-own-key traffic is handled. In ZRouter, BYOK requests bypass the shared response cache entirely.</p><p><strong>Stale answers after content changes</strong></p><p>Pick a TTL that matches how often the truth changes. When you ship a big content update, expect old entries to live until they expire, or clear the cache.</p><p><strong>Unstable prompt prefixes</strong></p><p>For prompt caching, small changes at the start of a prompt (a date, a random ID, a reordered tool list) silently disable the cache. If your prompt-cache hit rate is near zero, look at the first few hundred tokens of consecutive requests and diff them.</p><h3>Key takeaways</h3><ul><li>Use response caching for repetitive, stable, non-personal traffic.</li><li>Use prompt caching almost everywhere, and especially for agents and long conversations.</li><li>Scope every response cache to the tenant and include every parameter that changes the answer in the key.</li><li>Give users and developers a way to bypass the cache per request.</li></ul><p><strong>Next in the series:</strong> [Part 4: Where to Put Your AI Cache]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62f090553b19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Real Benefits of AI Caching: Cost, Speed, Limits, and Reliability]]></title>
            <link>https://medium.com/@sali_13462/the-real-benefits-of-ai-caching-cost-speed-limits-and-reliability-fd11969287dd?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd11969287dd</guid>
            <category><![CDATA[ai-token-cost]]></category>
            <category><![CDATA[ai-token-optimization]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-caching-strategies]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 10:17:57 GMT</pubDate>
            <atom:updated>2026-10-23T10:17:57.078Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7GkGrAcJ9hxQ93lef8CB8g.png" /></figure><p>In <a href="https://./01-what-is-ai-caching.md">Part 1</a> we described the four layers of AI caching: exact response caching, semantic caching, provider prompt caching, and embedding caching. This post answers the obvious follow-up: what do you actually get for turning them on?</p><p>The short answer is five things: lower cost, lower latency, more headroom under rate limits, better resilience, and more consistent answers. Below we go through each one, with worked examples you can adapt to your own traffic. We use</p><p><a href="https://zrouter.si/">ZRouter</a></p><p>to show how each benefit shows up in practice.</p><p>A note on the numbers: provider prices change often, so the examples use round, illustrative figures. Plug in your own provider’s current rates to get real estimates.</p><h3>1. Lower cost</h3><p>Response caching removes calls entirely</p><p>A response cache hit costs nothing at the model provider. Your savings are simply your hit rate multiplied by your spend on those requests.</p><p><strong>Worked example.</strong> A customer support assistant handles 100,000 requests a month. Each request averages 1,500 input tokens and 300 output tokens. Assume a model priced at $2.50 per million input tokens and $10 per million output tokens.</p><ul><li>Input: 100,000 × 1,500 = 150M tokens → $375</li><li>Output: 100,000 × 300 = 30M tokens → $300</li><li>Total: <strong>$675 per month</strong></li></ul><p>Support traffic is highly repetitive. If the exact cache catches 15% of requests and the semantic cache catches another 20%, then 35% of calls never reach the provider:</p><ul><li>Model spend: 65% × $675 = <strong>$439</strong></li><li>Semantic lookups: about 85,000 embedding calls (every request that missed the exact cache) at roughly 20 tokens of final user text each. That is around 1.7M embedding tokens, which costs cents at typical embedding prices.</li></ul><p>That is about <strong>$236 saved per month</strong> on one assistant, before counting the latency improvement.</p><p>Prompt caching shrinks the repeated part</p><p>For workloads where every answer must be fresh, like agents, coding tools, and long chats, response caching rarely hits. Prompt caching still helps, because most of each request is the same prefix.</p><p><strong>Worked example.</strong> A coding agent session runs 40 turns. Each turn sends a 25,000-token stable prefix (system prompt, tool definitions, project files) plus a growing conversation. Ignore the conversation growth and focus on the prefix:</p><ul><li>Without prompt caching: 40 × 25,000 = 1M input tokens at full price.</li><li>With prompt caching: the first turn pays full price (some providers add a small write premium). Turns 2 to 40 read 975,000 prefix tokens at the provider’s cached rate.</li></ul><p>Providers discount cached input heavily. Depending on provider and model, cached input tokens are billed at roughly 10% to 50% of the normal input price. At a 90% discount, the prefix cost falls by close to 85% across the session. At a 50% discount, it still falls by close to half.</p><p>The catch is that you only get this if the prefix is actually identical every turn and the request reaches the same provider, the same model, and often the same API key. That is harder than it sounds, and it is one of the main reasons to handle it at a gateway (see Part 4). ZRouter’s prompt-cache planner adds the right directive for each provider automatically, and its session keeping feature pins every request in a detected session to the same target and the same provider key so the cache stays warm.</p><h3>2. Lower latency</h3><p>A model call has two slow parts: reading the prompt (time to first token) and writing the answer (generation time).</p><ul><li><strong>Response cache hits</strong> skip both. A Redis lookup takes a few milliseconds. A typical chat completion takes one to ten seconds. For the user, a cached answer feels instant.</li><li><strong>Semantic cache hits</strong> add an embedding call and a vector search before the answer, usually tens of milliseconds, which is still far faster than generating.</li><li><strong>Prompt cache hits</strong> cut time to first token, because the provider does not reprocess the long prefix. On very long prompts this can be the difference between a two-second pause and a near-immediate start.</li></ul><p>Latency matters beyond user patience. Agents chain many calls together. Saving a second on each of 40 steps saves 40 seconds on one task.</p><p>In ZRouter, streaming responses are cached as the raw event stream, so a cached streaming answer still arrives as a stream. Your chat UI renders it the same way, just much faster.</p><h3>3. More headroom under rate limits</h3><p>Providers limit requests per minute and tokens per minute. When you hit a limit, requests fail or queue.</p><p>Every response cache hit is a request that does not count against your provider limits. Every prompt cache hit can reduce the input tokens that count against token-per-minute limits on providers that discount cached tokens in their limit accounting.</p><p>A subtler benefit comes from <strong>request coalescing</strong>. Picture a product launch, where hundreds of users ask the same question in the same minute. A plain cache misses on all of them until the first answer returns. ZRouter coalesces concurrent identical misses in each gateway process: one request goes to the provider, and the rest wait and replay its answer. A spike of identical traffic becomes one provider call instead of hundreds.</p><h3>4. Better resilience</h3><p>A cache is also a buffer against provider trouble. During a brief outage or a period of heavy throttling, popular questions can still be answered from cache because the lookup happens before the request is sent anywhere.</p><p>ZRouter is careful about one edge case here. If a request is answered by a failover target rather than the primary target, the response is not cached. Otherwise the backup model’s answer would be stored under the primary model’s key and served long after the primary recovered. Entries stored before the outage keep serving until they expire.</p><h3>5. More consistent answers</h3><p>Language models do not always give the same answer to the same question. For some products, that variation is a problem: a pricing FAQ, a policy explanation, or a compliance answer should not change from one user to the next.</p><p>A response cache makes repeated questions return the same reviewed answer until the entry expires. That makes support quality easier to audit and reduces “the bot told me something different yesterday” tickets.</p><h3>What caching does not buy you</h3><p>To keep expectations honest:</p><ul><li><strong>It does not make novel requests cheaper.</strong> A brand new question with a brand new context gets full price, except for any cached prefix.</li><li><strong>It does not improve answer quality.</strong> A cache replays answers. A bad answer cached is a bad answer served many times, which is why expiry (TTL) matters.</li><li><strong>Semantic caching is not free.</strong> Each miss still pays for an embedding and a vector search. If your traffic is almost never repetitive, those lookups are pure overhead.</li></ul><h3>Measuring the benefit</h3><p>Turning a cache on is easy. Knowing whether it pays off takes data. Track at least:</p><ul><li><strong>Hit rate</strong> per layer (exact, semantic, prompt).</li><li><strong>Cost avoided</strong>: provider spend you would have paid without the hits.</li><li><strong>Latency</strong> for hits versus misses.</li><li><strong>Wrong-hit reports</strong> for the semantic layer, which tell you if your threshold is too loose.</li></ul><p>ZRouter records each cache hit as a usage entry tagged cache_type: exact or cache_type: semantic, with the caller’s user path. By default, usage totals only count provider-bound requests so your cost reports match your provider bill. Add cache_mode=all to include hits, or cache_mode=cached to see only hits:</p><pre># Provider spend only (default)<br>curl &quot;https://your-gateway/admin/usage/summary&quot; \<br>  -H &quot;Authorization: Bearer $AIGATEWAY_MASTER_KEY&quot;</pre><pre># Only cache hits<br>curl &quot;https://your-gateway/admin/usage/summary?cache_mode=cached&quot; \<br>  -H &quot;Authorization: Bearer $AIGATEWAY_MASTER_KEY&quot;</pre><p>There is also a cache overview at /admin/cache/overview, and every cached response carries an X-Cache header you can log on the client side.</p><h3>Key takeaways</h3><ul><li>Response caching saves the entire call and is the biggest win for repetitive traffic.</li><li>Prompt caching is the biggest win for long, fresh, multi-turn work like agents and coding tools.</li><li>Caching also buys latency, rate-limit headroom, resilience, and consistency.</li><li>Measure hit rates and cost avoided per layer, or you are guessing.</li></ul><p><strong>Next in the series:</strong> [Part 3: When to Use AI Caching, and When Not To]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd11969287dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is AI Caching? A Practical Guide to the Four Layers]]></title>
            <link>https://medium.com/@sali_13462/what-is-ai-caching-a-practical-guide-to-the-four-layers-d2616ab3abad?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2616ab3abad</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[prompt-caching]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 18:04:08 GMT</pubDate>
            <atom:updated>2026-10-22T18:04:08.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*veLupN8ti3sqpaiAbZntVQ.png" /></figure><h3>What Is AI Caching? A Practical Guide to the Four Layers</h3><p>Every call to a large language model costs money and time. You pay for each input token and each output token, and you wait while the model reads your prompt and writes its answer. In a busy application, a large share of those calls are repeats: the same help-center question, the same system prompt, the same 20-page document sent with every turn of a conversation.</p><p>AI caching is the practice of noticing that work and not paying for it twice.</p><p>This is the first post in a four-part series. Here we cover what AI caching is and the different layers it can happen at. Part 2 covers the benefits in numbers, Part 3 covers when caching helps and when it hurts, and Part 4 covers where to put each layer in your stack. Throughout the series we use</p><p><a href="https://zrouter.si/">ZRouter</a></p><p>an open source, OpenAI-compatible AI gateway, as a working reference, because it implements every layer described here in one place.Caching, but for models</p><p>Classic web caching is simple. A request for /logo.png always returns the same bytes, so you store them and serve the copy next time.</p><p>AI requests are messier for three reasons:</p><ol><li><strong>Outputs are not deterministic.</strong> Ask a model the same question twice and you may get two different wordings. Caching an answer means choosing one and reusing it.</li><li><strong>Inputs are large and mostly repeated.</strong> A chat request carries the full conversation history, a long system prompt, tool definitions, and maybe retrieved documents. The new part of each request is often a few dozen tokens at the end.</li><li><strong>The same question has many spellings.</strong> “How do I reset my password?” and “password reset steps?” mean the same thing but share almost no characters.</li></ol><p>Because of this, AI caching is not one technique. It is a set of layers, each catching a different kind of repetition.</p><h3>Layer 1: Exact response caching</h3><p><strong>What it is:</strong> Store the complete response to a request. When an identical request arrives, return the stored response without calling the model.</p><p><strong>What counts as identical:</strong> The request body after normalization, plus anything that changes the meaning of the request: which model it resolved to, which account sent it, and which policies ran on it.</p><p><strong>What you save:</strong> The whole call. No input tokens, no output tokens, and the response comes back in milliseconds instead of seconds.</p><p><strong>Example:</strong> A documentation assistant receives “What are your API rate limits?” two hundred times a day, sent by a widget that builds the exact same request every time. After the first call, the other 199 are free.</p><p>In ZRouter, the exact cache is backed by Redis and covers /v1/chat/completions, /v1/responses, /v1/messages, and /v1/embeddings. A hit is marked with a response header so you can see it:</p><pre>X-Cache: HIT (exact)</pre><p>Two details make the ZRouter version more useful than a naive “hash the body” approach:</p><ul><li><strong>Canonicalization.</strong> JSON key order and whitespace are normalized before hashing, so two clients that format the same request differently still share one entry.</li><li><strong>Request coalescing.</strong> If ten identical requests arrive at the same moment and none is cached yet, only one goes to the provider. The other nine wait and replay its answer. This prevents a burst of traffic from turning into a burst of identical paid calls.</li></ul><p>Streaming is handled too. A streaming miss stores the raw server-sent event bytes, and a streaming hit replays them as text/event-stream, so your client code does not change.</p><h3>Layer 2: Semantic caching</h3><p><strong>What it is:</strong> Store responses along with an embedding (a vector representing meaning) of the prompt. When a new prompt arrives, embed it, search for a stored prompt whose vector is close enough, and if one is found, return its response.</p><p><strong>What counts as a match:</strong> Similarity above a threshold, usually expressed as cosine similarity between 0 and 1. A high threshold such as 0.92 means “almost the same question”. A lower threshold catches more paraphrases but risks wrong answers.</p><p><strong>What you save:</strong> The model call, at the price of one embedding call and one vector search. Embeddings are typically far cheaper than generation, so the trade is usually good for repeated question patterns.</p><p><strong>Example:</strong> A support bot gets “how do I reset my password”, “I forgot my password, what now?”, and “password reset link not working?” The first two are the same need and can share an answer. The third is a different problem, and a well-tuned threshold keeps it separate.</p><p>ZRouter’s semantic layer uses an embedding provider you choose plus a vector store: Qdrant, pgvector, Pinecone, or Weaviate. A hit is labelled:</p><pre>X-Cache: HIT (semantic)</pre><p>ZRouter is deliberately conservative about what it matches on. Only the final user message is compared by meaning. Everything else (model, temperature, tools, other request options, and a limited window of conversation context) must match exactly as part of the key. That way a semantic hit never crosses from one model or configuration to another. It also never applies semantic matching to /v1/embeddings, because an embedding has to represent the exact text it was requested for.</p><h3>Layer 3: Provider prompt caching</h3><p><strong>What it is:</strong> The model provider keeps the processed form of a long, repeated prompt prefix in memory. When your next request starts with the same prefix, the provider skips reprocessing it and bills those tokens at a discount.</p><p><strong>What counts as a match:</strong> A shared prefix. The system prompt, tool definitions, and earlier conversation turns must be byte-identical and appear first. Anything after the first difference is processed normally.</p><p><strong>What you save:</strong> Part of the input cost and part of the time to first token. Output is still generated fresh, because the question at the end is new.</p><p><strong>Example:</strong> A coding agent sends a 30,000-token system prompt and project context on every turn. With prompt caching, turns two through fifty reuse that prefix. The new tokens at the end are billed normally, and the cached prefix is billed at the provider’s reduced cached-input rate.</p><p>This layer is different from the first two. The response is not reused at all. You still get a new, fresh answer for every request. What gets reused is the model’s work of reading the prompt.</p><p>Each provider exposes it differently. Some cache automatically, some need a cache key, some need explicit breakpoints, and some need you to create a cached-content object ahead of time. ZRouter handles this with a <strong>provider prompt-cache planner</strong> that is on by default. After it knows which provider and model will serve a request, it adds the right directive:</p><ul><li><strong>OpenAI:</strong> a stable prompt_cache_key, plus explicit breakpoints on models that support them.</li><li><strong>Anthropic:</strong> automatic ephemeral caching.</li><li><strong>Amazon Bedrock (Converse):</strong> a cache point after the stable prefix.</li><li><strong>Google Gemini (AI Studio):</strong> a cached-content object, created only after the same prefix is seen again within five minutes.</li></ul><p>If your client already sends its own cache directives, ZRouter leaves them alone.</p><h3>Layer 4: Embedding caching</h3><p><strong>What it is:</strong> Store the vector for a piece of text so you do not embed the same text twice.</p><p><strong>What you save:</strong> Embedding calls. Each one is cheap, but RAG pipelines and semantic caches make a lot of them.</p><p>ZRouter uses this in two ways. Requests to /v1/embeddings participate in the exact cache, so re-indexing the same documents does not re-bill you. Inside the semantic cache, identical lookup text is reused in memory for five minutes within the same account and embedder, and concurrent identical lookups share a single embedding call.</p><h3>A fifth layer you do not control: the KV cache</h3><p>Inside the model server, every transformer keeps a key-value (KV) cache of the tokens it has already processed in the current generation. It is the reason the second word of an answer comes out faster than the first. Provider prompt caching is essentially that KV cache, kept alive between your requests. You do not configure it directly, but it explains why prompt structure matters so much, which we cover in Part 3.</p><h3>The layers side by side</h3><pre>| Layer | What is reused | Match rule | Saves | Answer is fresh? |<br>|---|---|---|---|---|<br>| Exact response cache | Full response | Identical request | Entire call | No |<br>| Semantic cache | Full response | Similar final prompt, same everything else | Entire call, minus one embedding | No |<br>| Provider prompt cache | Processed prompt prefix | Identical leading tokens | Part of input cost and latency | Yes |<br>| Embedding cache | Vectors | Identical text | Embedding calls | Not applicable |</pre><p>The layers stack. A request can miss the exact cache, miss the semantic cache, and still get a prompt-cache discount from the provider. In ZRouter, all of them run in one gateway, in that order, after routing, workflows, and guardrails have produced the final request.</p><h3>Key takeaways</h3><ul><li>AI caching is a stack of layers, not a single switch.</li><li>Response caches (exact and semantic) skip the model entirely but reuse an old answer.</li><li>Prompt caching keeps every answer fresh while cutting the cost of the repeated prefix.</li><li>The right mix depends on how repetitive your traffic is and how much freshness matters.</li></ul><p><strong>Next in the series:</strong></p><p><a href="https://./02-benefits-of-ai-caching.md">Part 2: The Real Benefits of AI Caching</a></p><p>where we put numbers on cost, latency, rate limits, and reliability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2616ab3abad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bring Your Own Cloud Account: Deploy to Your AWS, Azure, or Google Cloud with NEXUS AI]]></title>
            <link>https://medium.com/@sali_13462/bring-your-own-cloud-account-deploy-to-your-aws-azure-or-google-cloud-with-nexus-ai-2a4c89aed8d2?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a4c89aed8d2</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[cloud-deployment]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 15:34:06 GMT</pubDate>
            <atom:updated>2026-10-22T15:38:27.834Z</atom:updated>
            <content:encoded><![CDATA[<p>By Platform Super Admin * * Cloud Deployment · Security · AWS · Azure · Google Cloud</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lpy6m21NM_-e8J-Q.png" /></figure><p>Your security team asks a simple question about the new app: “Which AWS account is it running in?”</p><p>If the answer is “the platform’s account”, the next questions get harder. Who can see the logs? Where does the database live? Whose bill does it appear on? Can we apply our own guardrails, tags, and audit trail?</p><p>NEXUS AI lets you answer with “ours”. You add your own cloud credentials as a deployment provider, and NEXUS AI builds and runs your apps and managed databases inside your AWS account, Azure subscription, or Google Cloud project. You keep the NEXUS AI workflow (dashboard, CLI, MCP, and AI Builder), and the resources stay in an account you control.</p><p>This guide explains how it works, what each provider needs, what NEXUS AI creates in your account, and what to watch for when you rotate or remove keys.</p><h3>What does “bring your own cloud account” mean?</h3><p>Bring your own cloud account (sometimes called bring your own key, or BYOK) means the platform acts on cloud resources using credentials you supply, in an account you own.</p><p>On NEXUS AI it changes where your resources live, not how you deploy:</p><p>Platform account (default)Your own cloud account</p><h3>Who should use their own cloud account?</h3><p>It is a good fit when:</p><ul><li><strong>Compliance requires it.</strong> Your data, logs, and backups must stay in an account that your organization owns and audits.</li><li><strong>You already have cloud commitments.</strong> Committed spend or credits with AWS, Azure, or Google Cloud can cover the runtime cost.</li><li><strong>You need network access to private resources.</strong> An app or database that must sit next to existing private infrastructure has to live in the same account.</li><li><strong>You want your own guardrails.</strong> Service control policies, Azure Policy, budgets, and alerts apply automatically to resources in your account.</li></ul><p>If you are prototyping or running a side project, the platform account is simpler. You can add your own account later; new deployments start using it from that point.</p><h3>Which providers and plans support it?</h3><p>Amazon Web Services</p><p>AWS App Runner</p><p>Amazon RDS (PostgreSQL, MySQL)</p><p>Pro, Enterprise</p><p>Microsoft Azure</p><p>Azure Container Apps</p><p>Azure Database for PostgreSQL and MySQL</p><p>Pro, Enterprise</p><p>Google Cloud</p><p>Cloud Run</p><p>Starter, Pro, Enterprise</p><p>The Free plan deploys to NEXUS AI’s Docker hosts. The Add Provider form shows which provider types your plan includes.</p><h3>How NEXUS AI chooses an account for each deployment</h3><p>The rules are simple, and they are worth knowing before you add keys:</p><ol><li><strong>New deployments use your account when you have one.</strong> When you deploy to AWS or Azure, NEXUS AI looks for an enabled provider of that type that you added. If you have several, it uses the one marked as default, then the oldest.</li><li><strong>Existing resources stay where they were created.</strong> Every AWS and Azure deployment and managed database records which provider created it. Redeploys, logs, scaling, and deletes always go to that same account. Adding your account later does not move existing deployments.</li><li><strong>There is no silent fallback.</strong> If the account a resource lives in is no longer connected, NEXUS AI stops with an error rather than acting in a different account.</li><li><strong>Without your own provider, the platform account is used.</strong> That is how every deployment worked before this feature existed.</li></ol><p>For Google Cloud, NEXUS AI uses the service account you add in place of the platform’s credentials.</p><h3>Before you start: create a dedicated identity</h3><p>Do not paste your personal administrator keys. Create an identity for NEXUS AI with only the access it needs, so you can audit and revoke it on its own.</p><h3>AWS: an IAM user for NEXUS AI</h3><p>Create an IAM user (for example nexus-ai-deployer) with programmatic access, and generate an access key for it.</p><p>NEXUS AI calls these AWS services when it deploys apps and databases to your account:</p><p>AWS serviceWhat NEXUS AI does with it</p><p>STS</p><p>Reads your account ID</p><p>CodeBuild</p><p>Creates a build project and runs image builds</p><p>ECR</p><p>Creates an image repository and pushes the built image</p><p>App Runner</p><p>Creates, updates, scales, and deletes your app services</p><p>CloudWatch Logs</p><p>Reads build and application logs</p><p>RDS and EC2</p><p>Creates managed databases and reads the networking they need</p><p>Start from these services when you write the user’s policy, and narrow it to the region you deploy in. Use a dedicated account or organizational unit for NEXUS AI workloads if you can, since IAM role creation is a powerful permission.</p><h3>Azure: a service principal</h3><p>Register an application in Microsoft Entra ID and create a client secret for it. You will need its tenant ID, client ID, and client secret.</p><p>Grant the service principal the <strong>Contributor</strong> role on the resource group you want NEXUS AI to use. NEXUS AI creates Container Apps, a container registry, log workspaces, storage, and managed databases there. Scoping the role to one resource group keeps the rest of your subscription out of reach.</p><h3>Google Cloud: a service account</h3><p>Create a service account in your project, then download a JSON key for it. You will also need:</p><ul><li>A Cloud Storage bucket for build artifacts</li><li>An Artifact Registry Docker repository for images</li><li>Optionally, a separate service account for your Cloud Run services to run as</li></ul><p>Give the deploying service account the roles it needs to build images, push to Artifact Registry, and deploy to Cloud Run in that project.</p><h3>Step 1: Open Deployment Providers</h3><p>Sign in to NEXUS AI and open <strong>Deployment Providers</strong> from the sidebar (/providers). Select <strong>Add Provider</strong>.</p><p>Give the provider a clear name, such as Production AWS (us-east-1) or Staging Azure. You will see this name later when you choose a default or disable a provider, so it should say which account it is.</p><h3>Step 2: Enter your credentials</h3><p>Pick the provider type, then fill in its fields.</p><p><strong>AWS App RunnerAzure Container Apps</strong></p><p>Subscription ID</p><p>The subscription to deploy into</p><p>Resource Group</p><p>The resource group you granted access to</p><p>Tenant ID</p><p>Your Microsoft Entra tenant</p><p>Client ID</p><p>The app registration’s client ID</p><p>Client Secret</p><p>The client secret you created</p><p><strong>Google Cloud Run</strong></p><p>Project ID</p><p>Your Google Cloud project ID</p><p>Service Account Key (JSON)</p><p>The full contents of the key file</p><p>Build Bucket</p><p>The Cloud Storage bucket for build artifacts</p><p>Artifact Registry Repo</p><p>The Docker repository name</p><p>Cloud Run Service Account</p><p>Optional. The identity your services run as</p><p>Save the provider. Secret fields (the AWS secret access key, Azure client secret, and Google Cloud service account key) are encrypted with AES-256-GCM before they are stored, and the dashboard never shows them again.</p><h3>Step 3: Set a default if you have more than one</h3><p>If you add more than one provider of the same type, mark the one new deployments should use as the default. For example, keep Production AWS as the default and use a separate NEXUS AI project for staging work.</p><p>You can disable a provider at any time. Disabling only stops new deployments from using it; deployments already running in that account can still be managed.</p><h3>Step 4: Deploy an app to your account</h3><p>From the dashboard, choose the cloud provider when you create a deployment. From the CLI, pass --provider:</p><pre>## AWS App Runner in your AWS account nexus deploy source --repo https://github.com/your-org/your-app --provider aws_app_runner --region us-east-1 ## Azure Container Apps in your subscription nexus deploy source --repo https://github.com/your-org/your-app --provider azure_container_apps ## Cloud Run in your Google Cloud project nexus deploy source --repo https://github.com/your-org/your-app --provider gcp_cloud_run --region us-central1</pre><p>Scripts that still use the older AWS value, aws_ecs_fargate, keep working.</p><p>AI assistants connected through the NEXUS AI MCP server use the same providers, so a deploy requested from Claude, Cursor, or Codex lands in your account too.</p><h3>Step 5: Add a managed database in the same account</h3><p>Managed databases follow the same rule as apps. With your AWS or Azure provider added, a new database is created in your account:</p><pre>nexus deploy source --repo https://github.com/your-org/your-app --provider aws_app_runner --create-db postgres</pre><p>NEXUS AI provisions the database, then injects its connection settings into the app as environment variables.</p><p>If the database must stay on a private network, it has to be in the same account as the app. NEXUS AI checks this and refuses to connect an app in one account to a private database in another.</p><h3>Step 6: Confirm the resources are in your account</h3><p>Do not take it on trust. After the first deployment, check your own console:</p><ul><li><strong>AWS:</strong> App Runner shows the service, ECR shows the image repository, and S3 has the nexusai-codebuild-&lt;account-id&gt;-&lt;region&gt; bucket.</li><li><strong>Azure:</strong> The resource group you chose contains the Container App and its registry.</li><li><strong>Google Cloud:</strong> Cloud Run lists the service, and Artifact Registry holds the image.</li></ul><p>Your cloud provider’s bill and audit logs (AWS CloudTrail, Azure Activity Log, or Google Cloud Audit Logs) will now show the work NEXUS AI does, under the identity you created.</p><h3>Rotating, disabling, and removing credentials</h3><p><strong>Rotate keys</strong> by creating a new key for the same identity, editing the provider in Deployment Providers, and pasting the new secret. Then delete the old key in your cloud console. Your deployments stay connected because the provider itself has not changed.</p><p><strong>Disable a provider</strong> to stop new deployments from using it. Existing deployments in that account can still be redeployed, scaled, and deleted.</p><p><strong>Delete a provider</strong> only after you have deleted its deployments and databases. A deleted provider cannot be recovered, and NEXUS AI will not reach into that account any more. If you delete a deployment afterwards, NEXUS AI removes only its own record, and the cloud resources stay in your account until you remove them yourself.</p><p><strong>Revoking the identity</strong> in your cloud console has the same effect as deleting the provider for every resource in that account. Do it deliberately.</p><h3>Security checklist</h3><ul><li>Use a dedicated identity per environment, never personal or root credentials.</li><li>Scope access to one region, resource group, or project where your provider allows it.</li><li>Turn on your provider’s audit logging before the first deploy.</li><li>Set a budget alert on the account or subscription.</li><li>Rotate keys on your usual schedule, and after anyone with access leaves.</li><li>Store app secrets in NEXUS AI secrets, not in deployment environment variables.</li></ul><h3>Common problems and the next useful step</h3><h3>Frequently asked questions</h3><h3>Do I pay NEXUS AI for the cloud resources in my account?</h3><p>No. Your cloud provider bills you directly for resources in your account. Your NEXUS AI plan covers the platform: the dashboard, CLI, MCP server, AI Builder, and deployment automation.</p><h3>Can I move an existing deployment into my own account?</h3><p>Not in place. Existing deployments stay in the account they were created in. Create a new deployment after you add your provider, check it, then delete the old one.</p><h3>Where are my cloud keys stored?</h3><p>In the NEXUS AI database, encrypted with AES-256-GCM. They are used only to call your cloud provider for your organization’s deployments and databases.</p><h3>Can I use more than one AWS account or Azure subscription?</h3><p>Yes. Add each one as its own provider and mark the one new deployments should use as the default. Each deployment keeps using the account it was created in.</p><h3>What happens if I disable my provider?</h3><p>New deployments of that type stop using it. Resources already in your account can still be managed through it.</p><h3>Does this work with deployments from AI assistants?</h3><p>Yes. Deployments requested through the NEXUS AI MCP server, CLI, dashboard, or AI Builder all follow the same rules.</p><h3>Start with one non-production app</h3><p>Add a provider for a staging account, deploy one app, and confirm it in your own console and audit log. Once you have seen exactly what NEXUS AI creates, add your production account and make it the default.</p><p>Open <strong>Deployment Providers</strong> in NEXUS AI to add your first cloud account.</p><p><em>Originally published at </em><a href="https://nexusai.run/blog/bring-your-own-cloud-account-deploy-to-your-aws-azure-or-google-cloud-with-nexus-ai-mvjpat45"><em>https://nexusai.run</em></a><em> on October 22, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a4c89aed8d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy a full-stack Python app with MongoDB using CLI or MCP]]></title>
            <link>https://medium.com/@sali_13462/deploy-a-full-stack-python-app-with-mongodb-using-cli-or-mcp-b2e40730ecb8?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2e40730ecb8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 06:52:19 GMT</pubDate>
            <atom:updated>2026-10-20T06:52:19.249Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YI4SpWGLHEsk8UQ9MGbE6Q.png" /></figure><p>Deploy a full-stack Python app with MongoDB using CLI or MCP</p><p>You have a Python app working on your laptop. Now you need somewhere to run it, a database that keeps its data, and a way to find out what went wrong when a request fails.</p><p>This guide walks through that next step. You will build a small notes app with a browser interface, a Flask backend, and MongoDB for storage, then deploy it on NEXUS AI.</p><p>You can deploy from your terminal with the CLI or ask an AI assistant to deploy through MCP. Both paths use the same application and database setup. Choose one deployment path to avoid creating two copies.</p><h3>Step 1: Understand what you are deploying</h3><p>The app has three parts:</p><p>PartWhat it doesFrontendAn HTML page with a form and a list of saved notesPython backendFlask routes that read and write notes through PyMongoMongoDBStores notes outside the app container</p><p>The request flow is:</p><pre>Browser<br>   |<br>   | HTTPS<br>   v<br>Flask app on NEXUS AI<br>   |<br>   | PyMongo connection over the deployment network<br>   v<br>MongoDB service</pre><p>Flask serves the HTML and the API from the same origin, so this example needs one web deployment and no separate frontend build.</p><p>We will use NEXUS AI managed infrastructure with provider: docker. Its MongoDB sidecar service supplies the app&#39;s connection settings, including MONGO_URI and MONGO_DATABASE. The MongoDB sidecar option is not supported on the Cloud Run, ECS Fargate, or Azure Container Apps deployment paths.</p><p>Before starting, have these ready:</p><ul><li>Python 3.12 and Git.</li><li>Docker for the local MongoDB example.</li><li>A GitHub account and an empty repository named python-mongo-notes.</li><li>A NEXUS AI account with access to managed container deployments and enough quota for the app and database.</li><li>Node.js 18 or later for the NEXUS AI CLI, or an MCP client such as Cursor or Claude Code.</li></ul><p>This is a shared public demo: everyone who opens the URL can read and add notes. Use sample content. Add authentication and per-user access controls before storing private information.</p><h3>Step 2: Create the project</h3><p>Run these commands in Bash or Zsh on macOS or Linux:</p><pre>mkdir python-mongo-notes<br>cd python-mongo-notes<br>python3 -m venv .venv<br>source .venv/bin/activate<br>mkdir templates</pre><p>Create requirements.txt:</p><pre>Flask&gt;=3.1,&lt;4<br>pymongo&gt;=4.10,&lt;5<br>gunicorn&gt;=23,&lt;24<br>python-dotenv&gt;=1,&lt;2</pre><p>Install the dependencies:</p><pre>python -m pip install -r requirements.txt</pre><p>These ranges keep the example within the intended major versions. Before maintaining a release, lock the exact versions you have tested.</p><p>Create .gitignore:</p><pre>.venv/<br>__pycache__/<br>.env<br>.env.*</pre><p>Your final project will contain:</p><pre>python-mongo-notes/<br>  app.py<br>  templates/<br>    index.html<br>  requirements.txt<br>  Dockerfile<br>  .dockerignore<br>  .gitignore</pre><h3>Step 3: Add the Python backend</h3><p>Create app.py:</p><pre>import os</pre><pre>from dotenv import load_dotenv<br>from flask import Flask, jsonify, render_template, request<br>from pymongo import MongoClient<br>from pymongo.errors import PyMongoError</pre><pre>load_dotenv()</pre><pre>app = Flask(__name__)<br>app.config[&quot;MAX_CONTENT_LENGTH&quot;] = 16 * 1024</pre><pre>client = MongoClient(<br>    os.environ[&quot;MONGO_URI&quot;],<br>    serverSelectionTimeoutMS=5000,<br>)<br>db = client[os.getenv(&quot;MONGO_DATABASE&quot;, &quot;appdb&quot;)]<br></pre><pre>@app.get(&quot;/&quot;)<br>def index():<br>    return render_template(&quot;index.html&quot;)<br></pre><pre>@app.get(&quot;/api/notes&quot;)<br>def list_notes():<br>    documents = db.notes.find().sort(&quot;_id&quot;, -1).limit(50)<br>    return jsonify([<br>        {&quot;id&quot;: str(note[&quot;_id&quot;]), &quot;text&quot;: note[&quot;text&quot;]}<br>        for note in documents<br>    ])<br></pre><pre>@app.post(&quot;/api/notes&quot;)<br>def create_note():<br>    data = request.get_json(silent=True)<br>    if not isinstance(data, dict):<br>        return jsonify(error=&quot;Send a JSON object.&quot;), 400<br>    text = data.get(&quot;text&quot;)<br>    if not isinstance(text, str) or not 1 &lt;= len(text.strip()) &lt;= 500:<br>        return jsonify(error=&quot;Enter a note between 1 and 500 characters.&quot;), 400<br>    text = text.strip()<br>    result = db.notes.insert_one({&quot;text&quot;: text})<br>    return jsonify(id=str(result.inserted_id), text=text), 201<br></pre><pre>@app.get(&quot;/health&quot;)<br>def health():<br>    try:<br>        client.admin.command(&quot;ping&quot;)<br>    except PyMongoError:<br>        return jsonify(status=&quot;unhealthy&quot;, database=&quot;unavailable&quot;), 503<br>    return jsonify(status=&quot;ok&quot;, database=&quot;connected&quot;)</pre><p>MONGO_URI comes from the environment. No database credentials belong in the source code or browser JavaScript. PyMongo manages connection pooling through MongoClient. See the <a href="https://www.mongodb.com/docs/languages/python/pymongo-driver/current/connect/mongoclient/">official MongoClient documentation</a>.</p><p>The /health route actually pings MongoDB. A working homepage alone does not tell you whether the app can reach its database.</p><h3>Step 4: Add the browser interface</h3><p>Create templates/index.html:</p><pre>&lt;!doctype html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;utf-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>  &lt;title&gt;Python + MongoDB Notes&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font: 18px system-ui; max-width: 640px; margin: 60px auto;<br>           padding: 0 20px; color: #142033; }<br>    input, button { font: inherit; padding: 12px; }<br>    input { width: 60%; }<br>    button { background: #0a60ff; color: white; border: 0;<br>             border-radius: 6px; cursor: pointer; }<br>    li { padding: 12px 0; overflow-wrap: anywhere; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;Your notes, saved with Python + MongoDB&lt;/h1&gt;<br>  &lt;form id=&quot;note-form&quot;&gt;<br>    &lt;label for=&quot;note&quot;&gt;New note&lt;/label&gt;&lt;br&gt;<br>    &lt;input id=&quot;note&quot; maxlength=&quot;500&quot; required&gt;<br>    &lt;button&gt;Save note&lt;/button&gt;<br>  &lt;/form&gt;<br>  &lt;p id=&quot;message&quot; role=&quot;status&quot;&gt;&lt;/p&gt;<br>  &lt;ul id=&quot;notes&quot;&gt;&lt;/ul&gt;<br>  &lt;script&gt;<br>    const form = document.querySelector(&#39;#note-form&#39;);<br>    const input = document.querySelector(&#39;#note&#39;);<br>    const message = document.querySelector(&#39;#message&#39;);</pre><pre>    async function loadNotes() {<br>      const response = await fetch(&#39;/api/notes&#39;);<br>      if (!response.ok) throw new Error(&#39;Could not load notes.&#39;);<br>      const notes = await response.json();<br>      const list = document.querySelector(&#39;#notes&#39;);<br>      list.replaceChildren();<br>      for (const note of notes) {<br>        const item = document.createElement(&#39;li&#39;);<br>        item.textContent = note.text;<br>        list.appendChild(item);<br>      }<br>    }</pre><pre>    form.addEventListener(&#39;submit&#39;, async (event) =&gt; {<br>      event.preventDefault();<br>      try {<br>        const response = await fetch(&#39;/api/notes&#39;, {<br>          method: &#39;POST&#39;,<br>          headers: { &#39;Content-Type&#39;: &#39;application/json&#39; },<br>          body: JSON.stringify({ text: input.value })<br>        });<br>        if (!response.ok) throw new Error(&#39;Could not save your note.&#39;);<br>        input.value = &#39;&#39;;<br>        message.textContent = &#39;Note saved.&#39;;<br>        await loadNotes();<br>      } catch (error) {<br>        message.textContent = error.message;<br>      }<br>    });</pre><pre>    loadNotes().catch(error =&gt; { message.textContent = error.message; });<br>  &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>The browser sends requests to /api/notes. Only the Python process connects to MongoDB. Using textContent also makes note content display as text instead of executable HTML.</p><h3>Step 5: Run the complete app locally</h3><p>Start a local MongoDB container:</p><pre>docker run -d \<br>  --name python-mongo-notes-db \<br>  -p 127.0.0.1:27017:27017 \<br>  -v python-mongo-notes-data:/data/db \<br>  mongo:7</pre><p>This local development database has no authentication and binds only to your machine’s loopback interface. The named volume stores data separately from the container. On later runs, start the existing container with docker start python-mongo-notes-db.</p><p>Create a local .env file:</p><pre>MONGO_URI=mongodb://127.0.0.1:27017/appdb<br>MONGO_DATABASE=appdb</pre><p>Start Flask:</p><pre>flask --app app run --port 8000</pre><p>Open http://127.0.0.1:8000, save a note, and refresh the page. The note should still appear.</p><p>In another terminal, check the database connection:</p><pre>curl --fail-with-body http://127.0.0.1:8000/health</pre><p>Expected response, with key order allowed to vary:</p><pre>{&quot;database&quot;:&quot;connected&quot;,&quot;status&quot;:&quot;ok&quot;}</pre><p>Checkpoint: the page loads, a note survives a refresh, and /health reports a database connection. Fix local errors before deploying.</p><h3>Step 6: Package the app and push it to GitHub</h3><p>Create Dockerfile:</p><pre>FROM python:3.12-slim<br>WORKDIR /app<br>ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1<br>COPY requirements.txt .<br>RUN pip install --no-cache-dir -r requirements.txt<br>COPY app.py .<br>COPY templates ./templates<br>EXPOSE 8000<br>CMD [&quot;sh&quot;, &quot;-c&quot;, &quot;exec gunicorn --bind 0.0.0.0:${PORT:-8000} --workers 2 --access-logfile - --error-logfile - app:app&quot;]</pre><p>Gunicorn runs Flask in the deployment container and listens on all container interfaces. Its logs go to stdout and stderr so you can inspect them through NEXUS AI. Flask’s development server is for local use; see <a href="https://flask.palletsprojects.com/en/stable/deploying/gunicorn/">Flask’s deployment guide</a>.</p><p>Create .dockerignore:</p><pre>.git<br>.venv<br>__pycache__<br>.env<br>.env.*</pre><p>Push the project to the empty GitHub repository you created. Replace YOUR_USERNAME first:</p><pre>git init<br>git add app.py templates/index.html requirements.txt Dockerfile .dockerignore .gitignore<br>git commit -m &quot;Add Python and MongoDB notes app&quot;<br>git branch -M main<br>git remote add origin https://github.com/YOUR_USERNAME/python-mongo-notes.git<br>git push -u origin main</pre><p>The explicit file list keeps your local .env out of the commit. For this tutorial, use a public repository containing only demo code. A private repository requires repository access configured in NEXUS AI.</p><h3>Step 7: Deploy using the CLI</h3><p>If you prefer an AI assistant, skip to Step 8. You only need one deployment path.</p><p>Install the CLI and sign in:</p><pre>npm install -g nexusapp-cli@latest<br>nexus auth login<br>nexus auth whoami</pre><p>Deploy the GitHub repository with its MongoDB service:</p><pre>nexus deploy source \<br>  --repo https://github.com/YOUR_USERNAME/python-mongo-notes.git \<br>  --branch main \<br>  --name python-mongo-notes \<br>  --provider docker \<br>  --environment DEVELOPMENT \<br>  --framework python \<br>  --dockerfile Dockerfile \<br>  --services mongodb \<br>  --wait</pre><p>Here is what matters in that command:</p><p>FlagPurpose--dockerfile DockerfileBuilds the app using your repository&#39;s Dockerfile--provider dockerSelects NEXUS AI managed container infrastructure--services mongodbAdds the MongoDB sidecar and injects its connection environment--environment DEVELOPMENTLabels this tutorial deployment as development--waitWaits for the deployment to reach a terminal build/run state</p><p>Do not pass your local .env file to this deployment. Its 127.0.0.1 address points to the app container in the cloud, which is a different machine from your laptop. The platform supplies the database connection instead.</p><p>Save the deployment ID from the output. Inspect its status and public URL:</p><pre>nexus deploy status python-mongo-notes</pre><p>For command details and version-specific options, see the <a href="https://github.com/nexusrun/nexusai/wiki/CLI">NEXUS AI CLI reference</a>.</p><h3>Step 8: Deploy using MCP instead</h3><p>MCP, the Model Context Protocol, lets an AI assistant call NEXUS AI deployment tools. You describe the task, and the assistant sends structured tool calls.</p><p>For Claude Code, connect the server:</p><pre>claude mcp add --transport http nexus-ai https://mcp.nexusai.run/mcp</pre><p>Complete browser sign-in when prompted. For Cursor, add the same URL in its MCP settings. The <a href="https://nexusai.run/mcp-deployment-platform">NEXUS AI MCP setup guide</a> explains the connection flow.</p><p>Allow the deployment read, create, and log scopes needed for this workflow: deployments:read, deployments:create, and deployments:logs.</p><p>Then send your assistant this prompt, replacing the repository URL:</p><blockquote>Deploy <a href="https://github.com/YOUR_USERNAME/python-mongo-notes.git">https://github.com/YOUR_USERNAME/python-mongo-notes.git</a> from branch main to NEXUS AI. Name it python-mongo-notes, use the docker provider and DEVELOPMENT environment, build with the repository Dockerfile, and attach the mongodb service. Keep health checks enabled. Confirm my account and available providers first. Follow the returned deployment ID until it is running, inspect health, and return its public URL. If deployment fails, inspect the build and runtime logs. Do not print database credentials.</blockquote><p>The assistant should first call nexusai_whoami and nexusai_providers_list with empty argument objects. The source deployment tool call then uses these arguments:</p><p>MCP tool: nexusai_deploy_source</p><pre>{<br>  &quot;repoUrl&quot;: &quot;https://github.com/YOUR_USERNAME/python-mongo-notes.git&quot;,<br>  &quot;repoBranch&quot;: &quot;main&quot;,<br>  &quot;name&quot;: &quot;python-mongo-notes&quot;,<br>  &quot;provider&quot;: &quot;docker&quot;,<br>  &quot;environment&quot;: &quot;DEVELOPMENT&quot;,<br>  &quot;framework&quot;: &quot;python&quot;,<br>  &quot;dockerfile&quot;: &quot;Dockerfile&quot;,<br>  &quot;services&quot;: [&quot;mongodb&quot;],<br>  &quot;healthCheckEnabled&quot;: true<br>}</pre><p>These JSON blocks are MCP tool arguments for your assistant, not terminal commands. Tool names may have a client-specific prefix. If your connection does not expose the services field, update the connection before proceeding with this recipe.</p><p>With the returned ID, the assistant checks progress:</p><p>MCP tool: nexusai_deploy_status</p><pre>{<br>  &quot;deploymentId&quot;: &quot;REPLACE_WITH_RETURNED_DEPLOYMENT_ID&quot;<br>}</pre><p>Once running, it checks platform health:</p><p>MCP tool: nexusai_deploy_health</p><pre>{<br>  &quot;deploymentId&quot;: &quot;REPLACE_WITH_RETURNED_DEPLOYMENT_ID&quot;<br>}</pre><p>A queued deployment is not yet a working application. Keep the actual returned ID and follow status through completion.</p><h3>Step 9: Verify the deployed app and MongoDB</h3><p>Whichever deployment path you used, copy the actual public HTTPS URL from the deployment output. Set it in your terminal, replacing the example:</p><pre>APP_URL=&#39;https://REPLACE_WITH_YOUR_APP_HOSTNAME&#39;<br>curl --fail-with-body &quot;$APP_URL/health&quot;</pre><p>The expected result is status: ok and database: connected. This explicit request tests the application&#39;s database check even if platform health checks use another route.</p><p>Create a note through the deployed API:</p><pre>curl --fail-with-body -X POST &quot;$APP_URL/api/notes&quot; \<br>  -H &#39;Content-Type: application/json&#39; \<br>  -d &#39;{&quot;text&quot;:&quot;My Python app is live with MongoDB.&quot;}&#39;</pre><pre>curl --fail-with-body &quot;$APP_URL/api/notes&quot;</pre><p>Open the public URL in your browser. The same note should appear. Add another note through the form and refresh.</p><p>Checkpoint: the HTTPS page works, the API can write and read notes, and the database health check succeeds. You have verified the full request path from browser to Python to MongoDB.</p><h3>Step 10: Read logs and deploy updates</h3><p>If something fails, start with the logs.</p><p>CLI:</p><pre>nexus deploy logs python-mongo-notes --type build --lines 100<br>nexus deploy logs python-mongo-notes --type runtime --lines 100</pre><p>MCP tool: nexusai_deploy_logs</p><pre>{<br>  &quot;deploymentId&quot;: &quot;REPLACE_WITH_RETURNED_DEPLOYMENT_ID&quot;,<br>  &quot;type&quot;: &quot;runtime&quot;,<br>  &quot;limit&quot;: 100<br>}</pre><p>Use &quot;type&quot;: &quot;build&quot; to inspect build failures.</p><p>SymptomFirst thing to checkModuleNotFoundErrorThe missing dependency is in the committed requirements.txtKeyError: &#39;MONGO_URI&#39;MongoDB was attached and its environment reached the appMongoDB connection timeoutThe database is running, and the deployed URI was not overwritten with localhostAuthentication failureThe injected database credentials match the existing database; inspect settings without printing secretsApp starts but URL failsGunicorn binds to 0.0.0.0 and the configured container portLatest edits are missingYou committed and pushed them to the deployment&#39;s branch</p><p>To release an update, commit and push the changed files, then run:</p><pre>nexus deploy redeploy python-mongo-notes --wait</pre><p>Or ask your assistant to use nexusai_deploy_redeploy:</p><pre>{<br>  &quot;deploymentId&quot;: &quot;REPLACE_WITH_RETURNED_DEPLOYMENT_ID&quot;<br>}</pre><p>For this repository-based deployment, omit name and provider overrides to use an in-place rebuild. Afterward, repeat the /health and notes checks. Existing notes should still be present; verifying this also catches accidental attachment to a new or empty database.</p><h3>Before using the app for real users</h3><p>The tutorial gives you a working deployment foundation. Before collecting real data, add authentication, per-user note ownership, and rate limits. Confirm persistent database storage and a backup policy, then test restoring a backup. App container storage and database backups serve different purposes.</p><p>If you choose MongoDB Atlas later, supply its connection URI through secure deployment settings and configure Atlas network access for your deployment’s outbound traffic. Atlas permits connections from entries in its <a href="https://www.mongodb.com/docs/atlas/security/ip-access-list/">IP access list</a>. For MCP workflows, keep credential-bearing URIs out of chat and tool arguments; configure them through the authenticated dashboard.</p><p>Start by saving one note, refreshing the page, and seeing it again at your public URL. From there, you can build on an application whose frontend, Python backend, and MongoDB connection have all been checked.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2e40730ecb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The NEXUS CLI Builder is the terminal interface to the same AI App Builder used on the NEXUS AI…]]></title>
            <link>https://medium.com/@sali_13462/the-nexus-cli-builder-is-the-terminal-interface-to-the-same-ai-app-builder-used-on-the-nexus-ai-27302d6cc212?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/27302d6cc212</guid>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[ai-builder]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 06:32:02 GMT</pubDate>
            <atom:updated>2026-10-20T06:32:02.646Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*9Gv2WEc17CY9EX_djnTdrQ.png" /></figure><p>The NEXUS CLI Builder is the terminal interface to the same AI App Builder used on the NEXUS AI website. You describe an app, the Builder creates files in a project, and later prompts revise that project. You can inspect and edit the files locally, check common syntax and import errors, open the browser preview, and explicitly deploy a snapshot. It is not a separate code generator: the terminal and browser use the same Builder session and checkpoints.</p><p>This guide follows one app from first prompt to deployment, then covers the commands you need when you want more control.</p><h3>Who is it for, and when should you use it?</h3><p>Use the NEXUS CLI Builder if you prefer a terminal workflow, want to make a quick app without first creating a project in the website, or want to combine AI changes with edits in your own code editor. It is also useful when you need a repeatable sequence of commands for an existing Builder project. A terminal beginner can stay in nexus builder chat; developers can pull the files, edit them locally, and push the result.</p><p>Use the browser Builder when you need to see and interact with the preview, use its visual editing tools, or inspect the app alongside the conversation. The NEXUS CLI prints a link to that page; it does not render a visual preview inside the terminal. If you already have an independent Git repository rather than a Builder snapshot, the regular source deployment workflow may be a better fit than starting a new Builder app.</p><p>The NEXUS CLI Builder does not silently deploy each AI response. Generation, checks, preview, and deployment are separate steps so you can inspect the result first.</p><h3>Before you start</h3><p>Install Node.js 18 or later, then install and sign in to the CLI:</p><pre>npm install -g nexusapp-cli@latest<br>nexus auth login<br>nexus auth whoami</pre><p>nexus auth login opens a browser for sign-in. If you already use a NEXUS AI API token in a noninteractive environment, set NEXUSAI_TOKEN instead. Run nexus --help or nexus builder --help to confirm the commands supported by your installed version.</p><p>Your account also needs an available AI provider. To see the provider IDs and whether they are allowed for your account, run:</p><pre>nexus builder providersIn interactive chat, /provider and /model present numbered choices, so you do not need to memorize IDs. If no provider is available, add or enable one under AI Providers on NEXUS AI Dashbaord. AI requests and automated fixes may use your Builder quota.</pre><h3>Example: build a small issue tracker</h3><p>Start a new interactive build from your normal terminal:nexus builder chat</p><p>The builder&gt; prompt is inside the chat. Type a description of the app, not a shell command. Your first app prompt creates a NEXUS AI project automatically; you do not need to create one in the UI. For example:</p><pre>builder&gt; Build an issue tracker for a small team. Include an issue list, status and priority filters, an issue detail view, and a form to add an issue. Use realistic sample data. Keep the layout usable on a phone.</pre><p>The CLI prints New build: ... (&lt;project-id&gt;), streams file and tool activity, and reports a saved checkpoint. Keep the project ID. It is the address you use to resume the app and run non-chat Builder commands. The app name and exact files depend on the generated result; this prompt is a concrete starting specification, not a guarantee that every requested behavior is production-ready.</p><p>To revise the same app, keep talking at builder&gt;:</p><pre>builder&gt; Make the issue form validate the title and show an inline error instead of submitting an empty issue.<br>builder&gt; Add an empty-state message when the selected filters match no issues.<br>builder&gt; /files<br>builder&gt; /check</pre><p>Describe the change you want and its expected behavior. A focused follow-up is easier to inspect than asking for many unrelated features at once. /files lists the current snapshot. /check reports static diagnostics such as a file and line number; it does not run the app.</p><p>Type /help at any point for the chat commands. Use Up and Down to revisit earlier prompts and commands in the current CLI session. The history is held in memory and is not saved across restarts.</p><h3>Choose an AI provider or model</h3><p>You can choose before the first prompt, or switch while working on an app:</p><pre>builder&gt; /provider<br>Choose an AI provider:<br>  1. Claude ...<br>  2. OpenAI ...<br>Provider number (Enter to cancel): 1<br>builder&gt; /model<br>builder&gt; /status</pre><p>The numbered entries reflect providers and models actually available to your account; they may differ from this example. The selection affects subsequent AI messages. Switching providers resets the model to that provider’s default until you select another model. /status shows the current project, provider, model, and file count.</p><p>Here “AI provider” means the model service generating code. Later, builder deploy --provider ... means the infrastructure provider running the deployed app. They are different settings.</p><h3>Start another app or resume this one</h3><p>Inside chat, /new clears the current chat target; your next ordinary prompt creates another project. It does not delete the previous app. /exit leaves Builder chat. If you launched chat from the interactive nexus shell, you return to that shell; otherwise you return to your normal terminal.</p><p>To return to the issue tracker after leaving, run this in your normal terminal, replacing the placeholder with the ID printed when you created it:</p><pre>nexus builder chat --project &lt;project-id&gt;</pre><p>For a single prompt without entering chat, use:</p><pre>nexus builder new &quot;Build a responsive issue tracker with a list, filters, and an add-issue form&quot;</pre><p>That also creates a project automatically and prints its ID. For an existing project, a one-shot follow-up is:</p><pre>nexus builder ask --project &lt;project-id&gt; &quot;Add an empty state to the filtered issue list&quot;</pre><h3>Inspect the files and fix a failed check</h3><p>Outside chat, the equivalent commands are:</p><pre>nexus builder files --project &lt;project-id&gt;<br>nexus builder check --project &lt;project-id&gt;</pre><p>check examines supported text files for syntax errors and checks relative imports against the current Builder files. For example, an error might point to an import in src/App.tsx whose target file does not exist. If the reported issue is appropriate for AI repair, run:</p><pre>nexus builder fix --project &lt;project-id&gt;<br>nexus builder check --project &lt;project-id&gt;</pre><p>fix passes the diagnostics to the AI, saves its changes, and checks again. It attempts repair up to twice by default; --attempts 3 changes that limit (maximum 5). Each AI attempt may consume Builder quota. Inspect the result after an automated fix: a passing static check means the checked syntax and relative imports passed, not that the app builds, behaves correctly, is secure, or has passing tests.</p><p>If you prefer to guide the fix yourself, ask a targeted question instead:</p><pre>nexus builder ask --project &lt;project-id&gt; &quot;The check reports a missing relative import in src/App.tsx. Fix that import without changing the issue form behavior.&quot;<br>nexus builder check --project &lt;project-id&gt;</pre><p>Use the path and diagnostic actually printed for your app. After that, open the browser preview and test the affected flow. For serious apps, also run the project’s own build, tests, and security review after pulling the code locally.</p><h3>Edit the generated app in your own editor</h3><p>Builder files live in the project snapshot, not automatically in your working directory. pull copies the snapshot to an empty local directory and writes a .nexus-builder.json sync manifest:</p><pre>nexus builder pull --project &lt;project-id&gt; --out ./issue-tracker</pre><p>Open ./issue-tracker in your editor, inspect its actual file structure, and make a change—for example, adjust the issue form&#39;s validation message or add a component. Then sync it back:</p><pre>nexus builder push --project &lt;project-id&gt; --from ./issue-tracker<br>nexus builder check --project &lt;project-id&gt;</pre><p>push includes local text files, including new files, and creates a new Builder checkpoint. It skips .git, node_modules, build output, and .env files. The sync is limited to 200 files and 2 MB of content; symlinks and binary/non-UTF-8 files are not supported. Keep secrets out of Builder files.</p><p>If you remove a file that was in the pulled snapshot, push stops and asks you to confirm the deletion:</p><pre>nexus builder push --project &lt;project-id&gt; --from ./issue-tracker --delete</pre><p>Use --delete only when you intentionally removed those files. For a single file, you can skip the pull/push cycle:</p><pre>nexus builder put src/components/IssueCard.tsx --from ./IssueCard.tsx --project &lt;project-id&gt;<br>nexus builder rm src/components/OldIssueCard.tsx --project &lt;project-id&gt;</pre><p>The Builder path in put or rm must match the project&#39;s file structure. put adds or replaces that file and rm deletes it; neither automatically edits imports elsewhere. Run check after either operation. File changes made through the CLI are shared with the browser Builder.</p><h3>What if someone edited the app after I pulled it?</h3><p>push compares the checkpoint recorded by pull with the current project checkpoint. If another Builder chat, browser edit, or file operation changed the app, push rejects your stale copy rather than overwriting those changes. Keep your local directory, pull the newest snapshot into a different empty directory, compare and merge your edits there, then push the merged directory. Do not simply add --delete: that flag confirms missing files, not a stale checkpoint.</p><h3>Review checkpoints and open the preview</h3><p>Each successful AI response or file edit produces a Builder checkpoint. To list them:</p><pre>nexus builder versions --project &lt;project-id&gt;</pre><p>The output includes message IDs. If you need an earlier file state, choose the intended ID and restore it:</p><pre>nexus builder revert &lt;message-id&gt; --project &lt;project-id&gt;</pre><p>Revert saves the restored files as a new checkpoint. It does not erase the intervening history. Review the listed version before reverting because it changes the current snapshot.</p><p>To inspect behavior, get the browser Builder URL:</p><pre>nexus builder open --project &lt;project-id&gt;</pre><p>Inside chat, /preview prints the same kind of link. Open it in a browser to run the preview, click through the issue list and form, and make sure the result matches your requirements. open only prints the URL; it does not launch a preview inside the terminal.</p><h3>Deploy the reviewed snapshot</h3><p>Deployment is explicit. After reviewing the files, running check, and testing the browser preview, deploy the current Builder snapshot:</p><pre>nexus builder deploy --project &lt;project-id&gt; --name issue-tracker --provider docker<br>nexus deploy list --project &lt;project-id&gt;</pre><p>The command creates a deployment from the current files and prints a deployment ID. docker here is a deployment provider, not an AI model. Other providers may be available for your account; for example, --provider gcp_cloud_run selects Google Cloud Run. You can supply --region &lt;region&gt; and --framework &lt;framework&gt; when needed. The CLI uses the project&#39;s framework hint, or nextjs if none is set, unless you override it—check the generated app before deployment if that default does not fit.</p><p>builder deploy does not automatically run builder check, your package&#39;s test suite, or a production build first. It submits a new deployment; it is not an in-place edit of an existing deployment. Deployment uses your normal infrastructure quotas and may incur charges. Check deployment status and logs through the normal deployment commands or dashboard if the build fails.</p><h3>Quick command map</h3><p>GoalIn builder&gt; chatFrom the normal terminalStart a new appFirst ordinary prompt, or /new then a promptnexus builder chat or nexus builder new &quot;...&quot;Continue an appOrdinary promptnexus builder chat --project &lt;id&gt; or nexus builder ask --project &lt;id&gt; &quot;...&quot;Get help/helpnexus builder --helpSelect AI/provider, /model, /statusnexus builder providers; start supports provider/model IDsInspect files/filesnexus builder files --project &lt;id&gt;Check and repair/check, /fixnexus builder check and nexus builder fix with --project &lt;id&gt;Open preview/previewnexus builder open --project &lt;id&gt;Edit locallyLeave chat, then use terminal commandspull, edit, push; or put/rm for one fileReview or restoreLeave chat, then use terminal commandsversions and revert with --project &lt;id&gt;DeployLeave chat, then use terminal commandnexus builder deploy --project &lt;id&gt; --name &lt;name&gt; --provider &lt;provider&gt;</p><h3>Common sticking points</h3><ul><li>“Where is my project?” The first Builder prompt creates it automatically. Copy the printed project ID. /status shows the ID during chat; use chat --project &lt;id&gt; to resume later.</li><li>“My provider is missing.” Run nexus builder providers. In chat, /provider lists supported providers allowed for your account. Configure one under website Settings → AI Providers if the list is empty.</li><li>“check passed, but preview or deployment failed.” Static checks do not execute the app or replace its build/tests. Inspect the browser preview and deployment logs, then fix the actual runtime or build failure.</li><li>“push says the Builder changed since pull.” Preserve your edits, pull into a new empty directory, merge, and push that newer copy.</li><li>“I typed /help and my shell rejected it.” Slash commands work only at the builder&gt; prompt. From your normal terminal, use nexus builder --help.</li><li>“I pressed Up but yesterday’s command is gone.” Chat history is only kept for the current CLI process. The Builder project’s files and checkpoints persist; use the project ID to resume them.</li></ul><p>For broader platform guidance, see the <a href="http://localhost:3002/docs">documentation</a>. For exact Builder flags in your installed CLI, run nexus builder --help or nexus builder &lt;command&gt; --help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27302d6cc212" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open-connector: connect your AI agents to 1,500+ apps without handing them your credentials]]></title>
            <link>https://medium.com/@sali_13462/open-connector-connect-your-ai-agents-to-1-500-apps-without-handing-them-your-credentials-48cb83030384?source=rss-710a951d832b------2</link>
            <guid isPermaLink="false">https://medium.com/p/48cb83030384</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[nexus-ai]]></category>
            <category><![CDATA[cursor-ai]]></category>
            <dc:creator><![CDATA[Sali]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 13:01:44 GMT</pubDate>
            <atom:updated>2026-09-27T13:24:56.673Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AI agents are only as useful as the tools they can reach. An agent that can read your GitHub issues, post to Slack, update a Notion page, and pull a BigQuery report can do real work. The usual way to get there is also the riskiest: paste API keys and OAuth tokens into the agent’s environment and hope nothing leaks into a prompt, a log, or a model’s context window.</strong></p><p>By Platform Super Admin * * AI Agents · Open Source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bgq79W2m-RhcNkWG.png" /></figure><p><strong>Published:</strong> September 27, 2026 <strong>Category:</strong> AI Agents · Open Source <strong>Reading time:</strong> 9 minutes <strong>Author:</strong> NEXUS AI Team</p><p>AI agents are only as useful as the tools they can reach. An agent that can read your GitHub issues, post to Slack, update a Notion page, and pull a BigQuery report can do real work. The usual way to get there is also the riskiest: paste API keys and OAuth tokens into the agent’s environment and hope nothing leaks into a prompt, a log, or a model’s context window.</p><p><strong>open-connector</strong> is an open-source answer to that problem. It sits between your agents and the apps they use, holds every credential behind its own boundary, and gives agents a clean catalog of Actions they can discover and call. This guide covers what it is, what to use it for, how to use it, and how to deploy your own instance on NEXUS AI in one click with authentication switched on from the first start.</p><blockquote><em>open-connector is built and maintained by </em><a href="https://github.com/oomol-lab/open-connector"><em>OOMOL</em></a><em> under the Apache-2.0 license. NEXUS AI is not affiliated with OOMOL. The open-connector project lists NEXUS AI as a one-click deploy option in its </em><a href="https://github.com/oomol-lab/open-connector/tree/main/docs/deployment-options"><em>deployment docs</em></a><em>.</em></blockquote><h3>What is open-connector?</h3><p>open-connector is a <strong>connector gateway for AI agents</strong>, and an open-source alternative to hosted tools such as Pipedream and Composio. You connect app accounts to it once. Your agents and applications then call those apps through it, using a shared catalog of providers and prebuilt Actions.</p><p>As of September 2026 the public catalog lists <strong>1,566 providers and 18,267 Actions</strong>, covering products such as GitHub, Gmail, Notion, Slack, Airtable, Supabase, BigQuery, and Google Analytics.</p><p>What it gives you:</p><ul><li><strong>A credential boundary.</strong> API keys, OAuth tokens, and custom credentials live inside the runtime, encrypted at rest. Agents receive Action results and safe account labels, never the secrets themselves.</li><li><strong>Inspectable Action contracts.</strong> Every Action has request and response schemas and its required scopes, so an agent (or a developer) can see exactly what a call does before running it.</li><li><strong>Runtime controls.</strong> Runtime tokens, scopes, allow and block policies per Action, named connections for multiple accounts, and redacted run logs.</li><li><strong>A web console</strong> for browsing the catalog, configuring credentials, creating runtime tokens, debugging Actions, and reviewing recent runs.</li></ul><h3>How it works</h3><p>An agent or app calls open-connector. open-connector checks the caller’s token and policy, looks up the right connection, runs the Action against the provider, and returns the result. The provider credential never leaves the gateway.</p><pre>AI agent / app ──SDK · CLI · MCP · HTTP──▶ open-connector ──▶ GitHub, Slack, Notion, ... │ ├─ credentials (encrypted) ├─ tokens, scopes, allow/block policies └─ run logs</pre><h3>What to use open-connector for</h3><ul><li><strong>Give coding agents safe access to your tools.</strong> Point Claude Code, Cursor, or any MCP client at open-connector and let it search and run Actions across your apps, without putting a single provider token in the agent’s config.</li><li><strong>Build agent products that act on your users’ apps.</strong> If your product needs to create issues, send emails, or read spreadsheets on a user’s behalf, open-connector gives you one API and consistent Action contracts instead of dozens of separate integrations.</li><li><strong>Keep integrations under your control.</strong> Self-hosting means credentials, logs, and policies stay on infrastructure you run, which matters for security reviews and compliance.</li><li><strong>Start hosted, move private later.</strong> OOMOL also offers a hosted runtime with managed OAuth. Provider ids, Action ids, and schemas are the same across hosted and self-hosted, so you can switch without rewriting your agent.</li></ul><h3>Four ways to call it</h3><h3>How to deploy open-connector on NEXUS AI</h3><p>A fresh open-connector with no tokens configured <strong>accepts every request</strong>: anyone who finds the URL can use the console and run Actions. The NEXUS AI template closes that gap at deploy time. It requires an admin token, generates the encryption key and a runtime token on the server, and sets the public origin to your deployment’s URL, so every surface requires authentication from the first start.</p><h3>Step 1 — Open the one-click deploy link</h3><p>Go to the <a href="https://nexusai.run/templates/open-connector">open-connector template</a> and click <strong>Deploy</strong>, or use the Deploy to NEXUS AI button in open-connector’s own deployment docs. Sign in or create a free NEXUS AI account; no credit card is needed.</p><p>The link builds the repository’s docker/Dockerfile from source, so you always get the current version.</p><h3>Step 2 — Choose your admin token</h3><p>The deploy form asks for one value: OOMOL_CONNECT_ADMIN_TOKEN. Pick a long random string and save it in your password manager. It is how you sign in to the console and the admin API.</p><p>Everything else is handled for you:</p><ul><li>OOMOL_CONNECT_ENCRYPTION_KEY is generated on the server and encrypts stored credentials.</li><li>OOMOL_CONNECT_RUNTIME_TOKEN is generated on the server, which switches on authentication for /v1 and /mcp.</li><li>OOMOL_CONNECT_ORIGIN is set to your deployment URL, so OAuth callbacks point at the right place.</li></ul><p>None of these secrets appear in the deploy link. Click <strong>Deploy</strong> and watch the build. When it reaches Running, you have a public HTTPS URL such as <a href="https://open-connector-abc.nexusai.run./">https://open-connector-abc.nexusai.run.</a></p><h3>Step 3 — Sign in to the web console</h3><p>Open your URL and enter your admin token. The Overview page shows runtime readiness, available providers, executable Actions, and recent calls.</p><p>To confirm the runtime works, run a no-auth Action. Runtime calls need a runtime token, which you create in the next step, so you can also try it from the console’s Action debugger first.</p><h3>Step 4 — Connect your first provider</h3><p>GitHub is the simplest credentialed example because it accepts a personal access token. In the console, open GitHub and paste the token. Or use the admin API:</p><pre>curl -s -X PUT https://&lt;your-app&gt;.nexusai.run/api/connections/github \ -H &quot;Authorization: Bearer $ADMIN_TOKEN&quot; \ -H &#39;content-type: application/json&#39; \ -d &#39;{&quot;authType&quot;:&quot;api_key&quot;,&quot;values&quot;:{&quot;apiKey&quot;:&quot;github_pat_...&quot;}}&#39;</pre><p>For OAuth providers such as Google or Slack, register an OAuth app with that provider and use this callback URL:</p><pre>https://&lt;your-app&gt;.nexusai.run/oauth/callback</pre><p>The console (or GET /api/oauth/configs) shows the exact expectedRedirectUri for each provider. Paste the client ID and secret into the console, then authorize.</p><h3>Step 5 — Create a runtime token for each agent</h3><p>In the console’s <strong>Access</strong> tab, create a runtime token for each agent or app. Tokens start with oct_ and can be limited to specific Actions and connections, so a reporting agent never gets write access to your repos.</p><p>Call an Action over HTTP:</p><pre>curl -s -X POST https://&lt;your-app&gt;.nexusai.run/v1/actions/github.get_current_user \ -H &quot;Authorization: Bearer oct_...&quot; \ -H &#39;content-type: application/json&#39; \ -d &#39;{&quot;input&quot;:{}}&#39;</pre><h3>Step 6 — Connect your agent over MCP</h3><p>Claude Code:</p><pre>claude mcp add --transport http open-connector https://&lt;your-app&gt;.nexusai.run/mcp \ --header &quot;Authorization: Bearer oct_...&quot;</pre><p>Cursor (.cursor/mcp.json):</p><pre>{ &quot;mcpServers&quot;: { &quot;open-connector&quot;: { &quot;url&quot;: &quot;https://&lt;your-app&gt;.nexusai.run/mcp&quot;, &quot;headers&quot;: { &quot;Authorization&quot;: &quot;Bearer oct_...&quot; } } } }</pre><p>Now ask your agent to “list my connected apps” or “find the Action that creates a GitHub issue”. It discovers Actions with search_actions, reads the guide with get_action_guide, and runs them with execute_action, while the GitHub token stays inside open-connector.</p><h3>Taking it to production</h3><p>The template stores data in SQLite inside the container. That is fine for trying it out: data survives restarts, but a rebuild starts fresh. For data that has to last:</p><ul><li><strong>Use PostgreSQL.</strong> Set OOMOL_CONNECT_DATABASE_URL to a PostgreSQL connection URL, such as a NEXUS AI managed database.</li><li><strong>Run migrations first.</strong> PostgreSQL migrations are explicit. Run npm run runtime:migrate before the first start and before each new version that adds migrations; the server refuses to start until the schema is current. See the <a href="https://github.com/oomol-lab/open-connector/blob/main/docs/configuration.md#runtime-database">runtime database guide</a>.</li><li><strong>Keep the encryption key.</strong> Stored credentials are encrypted with OOMOL_CONNECT_ENCRYPTION_KEY. Copy the generated value from your deployment&#39;s environment into your secrets manager, and keep it unchanged when you move or redeploy.</li><li><strong>Use a custom domain</strong> on a paid NEXUS AI plan, and update your OAuth apps’ callback URLs to match.</li></ul><h3>Frequently asked questions</h3><h3>Is open-connector free?</h3><p>Yes. open-connector is open source under Apache-2.0. You can run it on the NEXUS AI Free plan, which includes one active deployment with a public HTTPS URL and no credit card.</p><h3>Do I need to register my own OAuth apps?</h3><p>For OAuth providers on a self-hosted runtime, yes: you register an OAuth app with each provider and point it at your /oauth/callback URL. API-key providers such as GitHub (personal access tokens) and no-auth providers work without one. If you want managed OAuth without registering apps, OOMOL offers a hosted runtime.</p><h3>Can Claude Code and Cursor use open-connector?</h3><p>Yes. Both connect to the /mcp endpoint with a runtime token in the Authorization header, as shown in Step 6. Any MCP client that supports HTTP transport and custom headers works the same way.</p><h3>Where are my credentials stored, and who can see them?</h3><p>Inside your open-connector database, encrypted with your encryption key. Agents never receive provider secrets, only Action results and safe account labels. Runtime tokens can be limited to specific Actions and connections.</p><h3>What happens to my data if I rebuild the deployment?</h3><p>With the default SQLite storage, a rebuild starts with an empty database, so connections need to be added again. Stopping and starting keeps the data. Use PostgreSQL for anything you need to keep.</p><h3>Is the Deploy to NEXUS AI button official?</h3><p>Yes. The open-connector project lists NEXUS AI in its README and deployment docs, alongside Cloudflare, <a href="http://fly.io/">Fly.io</a>, and other platforms.</p><p><strong>Deploy your own open-connector:</strong> <a href="https://nexusai.run/templates/open-connector">nexusai.run/templates/open-connector</a></p><p><strong>More one-click open-source apps:</strong> <a href="https://nexusai.run/templates">nexusai.run/templates</a></p><p><strong>Maintain an open-source project?</strong> Add a Deploy to NEXUS AI button to your README: <a href="https://nexusai.run/kb/deploy-button">nexusai.run/kb/deploy-button</a></p><p><em>Originally published at </em><a href="https://nexusai.run/blog/open-connector-connect-your-ai-agents-to-1-500-apps-without-handing-them-your-credentials-mujtuud9"><em>https://nexusai.run</em></a><em> on September 27, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48cb83030384" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>