<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tomás Herrera</title>
    <description>The latest articles on DEV Community by Tomás Herrera (@linnn_charm_2e397112f3b51).</description>
    <link>https://dev.to/linnn_charm_2e397112f3b51</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3861661%2F621e3031-9082-4007-8e9a-a112b25c0c85.png</url>
      <title>DEV Community: Tomás Herrera</title>
      <link>https://dev.to/linnn_charm_2e397112f3b51</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/linnn_charm_2e397112f3b51"/>
    <language>en</language>
    <item>
      <title>Don't File Photo-Derived Meters as a Survey</title>
      <dc:creator>Tomás Herrera</dc:creator>
      <pubDate>Sun, 15 Nov 2026 02:11:41 +0000</pubDate>
      <link>https://dev.to/linnn_charm_2e397112f3b51/dont-file-photo-derived-meters-as-a-survey-1gh0</link>
      <guid>https://dev.to/linnn_charm_2e397112f3b51/dont-file-photo-derived-meters-as-a-survey-1gh0</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fte334yoww22kinrjkatz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fte334yoww22kinrjkatz.jpg" alt="Don't File Photo-Derived Meters as a Survey — OGP tech card about photo-to-plan jobs and estimated dimensions" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm Tomás Herrera. Day job is backend and infrastructure at ArchyBase — mostly the path from an uploaded file to a finished artifact: validate, store, enqueue, and return a result the rest of the system is allowed to trust. This post is about a sibling product our team also builds, and specifically about &lt;a href="https://floorai.ai/image-to-floor-plan" rel="noopener noreferrer"&gt;a converter that turns a photo into a layout&lt;/a&gt;. I'm not going to talk about the vision model. That's a different layer, and a different person on the team. I'm talking about what the job is allowed to persist after a photo comes in.&lt;/p&gt;

&lt;p&gt;The short version: a listing photo is a projection. The layout you get back is a draft estimated from what's visible in the frame. If your property record, your quote, or your inventory system files those numbers as a survey, you've promoted an estimate to a fact. I don't want that write to happen by accident.&lt;/p&gt;

&lt;h2&gt;
  
  
  The job is not “upload, then believe”
&lt;/h2&gt;

&lt;p&gt;The product page is honest about the shape of the work, and I like that more than a magic demo. You upload a JPEG, PNG, or WebP (up to 10MB). You can add a short note about what the floor plan should look like. You pick a quality mode. You get a 2D technical plan back, as an image, and you can regenerate if the first pass misses a wall.&lt;/p&gt;

&lt;p&gt;That last clause matters. “Regenerate if the first pass misses a wall” is not a flourish. It is an admission that a missed wall is a normal failure class, not a rare crash. A backend that treats the first successful blob as authoritative will happily store an open floor where a wall should have been.&lt;/p&gt;

&lt;p&gt;So the durable unit of work, for me, looks closer to this than to a one-shot HTTP response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Job {
  job_id
  input_ref          // object key for the photo
  input_kind         // room_photo | house_interior | aerial
  hint?              // optional text, not a measured brief
  quality_mode       // fast | best  (latency vs refinement; not a SLA)
  state              // queued | running | succeeded | failed
  result_ref?        // output image
  error_class?       // invalid_input | unreadable_photo | incomplete_layout | internal
  confidence_policy  // estimated_from_visible — never survey_grade
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I made up the field names. They are not FloorAI internals. They're the checklist I want in front of any service that accepts a photo and emits a plan-shaped artifact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three input types are three failure classes
&lt;/h2&gt;

&lt;p&gt;The page groups inputs as a room photo, a wider house interior, or an aerial / drone shot of a building. That's a product convenience. For a job queue, it's a classification problem, because the failure modes don't overlap cleanly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A room photo&lt;/strong&gt; usually gives you two or three walls, a floor plane, maybe a doorway, and a lot of furniture occluding the rest. The missing wall is often the one behind the camera. If you persist that result as a complete room, you've invented a fourth side from a viewpoint that never saw it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A house interior&lt;/strong&gt; — a wider shot, a listing gallery image, a scanned print — can show circulation and room boundaries, but only the ones in view. A corridor that turns out of frame will not appear because the model is “careful.” It will not appear because it was never in the pixels. Old or low-quality photos can still convert, which is useful for digitizing a record when no drawing exists. Useful is not the same as complete.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An aerial or drone shot&lt;/strong&gt; is a different object. The page is explicit: you can scan a footprint when you can't walk the building room by room. A footprint is not a room schedule. If a downstream form labels the output “3-bed, 2-bath” because a listing caption said so, that's a caption write, not a measurement write. Keep those sources apart.&lt;/p&gt;

&lt;p&gt;I would rather the API require an &lt;code&gt;input_kind&lt;/code&gt; (or infer it and show the inference) than silently mix these into one “image-to-plan” success state. The client can then branch: a missed interior wall is “try another photo or regenerate”; an aerial result is “this is a footprint, don't ask it for closet widths.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9fg1nxfbx80vrn7nc2ny.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9fg1nxfbx80vrn7nc2ny.jpg" alt="Desk with a photo-derived floor plan on a monitor, a printed room photo, and a marked-up plan with unanswered questions" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Reject early, estimate later
&lt;/h2&gt;

&lt;p&gt;Upload validation should be boring and strict:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reject empty files, wrong MIME types, and anything over the published 10MB cap before a worker starts.&lt;/li&gt;
&lt;li&gt;Decode enough to know you have an actual image, not a renamed PDF.&lt;/li&gt;
&lt;li&gt;Don't invent a dimension unit in preprocess just because a later renderer likes meters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The estimate happens after that, from visible structure in the shot — walls, doorways, room boundaries the photo actually contains. The page says this directly: no tape measure is required, and dimensions are estimated from what's visible rather than from measurements you typed in. That's the product promise, and it should also be the persistence promise.&lt;/p&gt;

&lt;p&gt;What I will not do is this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accept a phone photo.&lt;/li&gt;
&lt;li&gt;Get a layout image with some numbers on it.&lt;/li&gt;
&lt;li&gt;OCR or hardcode those numbers into &lt;code&gt;wall.length_m&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Mark the unit as surveyed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you need a field, call it what it is: &lt;code&gt;estimated_from_photo&lt;/code&gt;, with the source image id and the job id. A later measured drawing can replace it. A later photo can revise it. Neither should look identical to a laser-measured wall in the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failures the user can act on
&lt;/h2&gt;

&lt;p&gt;I care about error classes the client can branch on, not a generic “something went wrong.” A reasonable set for this product shape:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Class&lt;/th&gt;
&lt;th&gt;What happened&lt;/th&gt;
&lt;th&gt;What the user can do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;invalid_input&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;bad type, empty file, over 10MB&lt;/td&gt;
&lt;td&gt;fix the file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;unreadable_photo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;decode failed, or the frame has no usable structure&lt;/td&gt;
&lt;td&gt;try a wider / sharper shot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;incomplete_layout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;job succeeded, but a wall or room boundary is obviously missing&lt;/td&gt;
&lt;td&gt;regenerate, or upload a shot that includes the missing side&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wrong_kind&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an aerial footprint was treated like an interior, or the reverse&lt;/td&gt;
&lt;td&gt;relabel the input and run again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;worker / storage blip&lt;/td&gt;
&lt;td&gt;retry the same job or attempt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;incomplete_layout&lt;/code&gt; is the interesting one, because it may still return an image. That's a succeeded job with a warning, or a soft failure, depending on how strict you want to be. I prefer “succeeded, with an explicit warning the first pass may have missed a wall” over a silent 200 and a floor plan that walks through a load-bearing line. The product already tells people to regenerate. The API should make that path first-class, not a folksy tip buried under a download button.&lt;/p&gt;

&lt;p&gt;Don't auto-retry &lt;code&gt;invalid_input&lt;/code&gt; or “I can't see a room in this picture.” That wastes worker time and trains the UI to spin. Auto-retry only the infra blips, and only with an idempotency key so you don't persist two final images for one photo.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the output is allowed to be
&lt;/h2&gt;

&lt;p&gt;The download is an image, ready to share or use as a starting reference. Starting reference is the right phrase. It is not a CAD handoff, and I have not claimed it exports a measured drawing. If someone on the team later adds a dimensioned file type, that still wouldn't make a phone photo into a survey. It would make the estimate easier to open in other tools — which is useful, and still an estimate.&lt;/p&gt;

&lt;p&gt;The optional text field — “describe what the floor plan should look like” — is a hint, not a substitute for the hidden wall. If the photo doesn't show a second bedroom, a hint that says “two bedrooms” is a request, not evidence. I'd keep that hint on the job record so a reviewer can see what was asked, and I would not let it silently overwrite geometry that isn't in the image.&lt;/p&gt;

&lt;p&gt;Quality modes (faster output vs more refinement) are a latency and compute trade-off. I'm not going to invent how many seconds either mode takes. The only rule I want is: both modes still write &lt;code&gt;estimated_from_visible&lt;/code&gt;. A “best” result is not a license to drop the qualifier.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist before anyone files the result
&lt;/h2&gt;

&lt;p&gt;This is the list I want next to the download button, or next to whatever internal tool first persists the artifact:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Record the source photo and the job id with the layout. No orphan plans.&lt;/li&gt;
&lt;li&gt;Label the input kind: room, interior, or aerial / footprint.&lt;/li&gt;
&lt;li&gt;Treat every length as estimated from the visible frame, never as surveyed, until a real measurement replaces it.&lt;/li&gt;
&lt;li&gt;If a wall is missing, regenerate or shoot the missing side. Don't close the loop in the database by hand and call it the same job.&lt;/li&gt;
&lt;li&gt;Don't copy listing-caption room counts into the plan record just because the caption was on the same page as the photo.&lt;/li&gt;
&lt;li&gt;Let a later measured plan supersede the estimate without deleting the photo job — you want the history.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I use this converter when there is no drawing on file and a photo is all you have. That's a real situation: old units, incomplete listing packs, a job site with no blueprint in the email thread. A draft layout from a photo is much better than a blank. It is not better than a survey, and it should never be stored as if it were one.&lt;/p&gt;

&lt;p&gt;The unpaid work, on the backend, is making that distinction boring and visible. If the only success state you have is “image arrived,” you will eventually file photo-derived meters as a survey. I'd rather fail that write on purpose.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>infrastructure</category>
      <category>software</category>
    </item>
    <item>
      <title>Walls Are Edges: Closing Loops Into Rooms Without Lying About Area</title>
      <dc:creator>Tomás Herrera</dc:creator>
      <pubDate>Tue, 03 Nov 2026 05:51:09 +0000</pubDate>
      <link>https://dev.to/linnn_charm_2e397112f3b51/walls-are-edges-closing-loops-into-rooms-without-lying-about-area-2j9m</link>
      <guid>https://dev.to/linnn_charm_2e397112f3b51/walls-are-edges-closing-loops-into-rooms-without-lying-about-area-2j9m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffx33hgix194vijqac1fu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffx33hgix194vijqac1fu.jpg" alt="Walls Are Edges — OGP tech card about closing wall loops into rooms without lying about area" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm Tomás Herrera. I spend most days on backend and infrastructure at ArchyBase — queues, contracts, the boring path that keeps geometry from becoming folklore. This post is about a sibling product our team also builds, &lt;a href="https://www.floorai.ai/" rel="noopener noreferrer"&gt;FloorAI&lt;/a&gt;, and specifically about how an interactive editor should treat walls as topology rather than as decorative polylines. The concrete surface is the free &lt;a href="https://www.floorai.ai/floor-plan-maker" rel="noopener noreferrer"&gt;Floor Plan Maker&lt;/a&gt;: draw with &lt;code&gt;W&lt;/code&gt;, close a room with &lt;code&gt;R&lt;/code&gt;, snap exact lengths in meters or feet-inches, watch room areas update, drop furniture/doors/windows, duplicate options, export when the model is honest.&lt;/p&gt;

&lt;p&gt;I'm not going to invent a latency number or a user count. I'm going to talk about the data model that makes "this is a room of 18.6 m²" a derived fact instead of a sticker someone typed once.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap: walls as strokes
&lt;/h2&gt;

&lt;p&gt;A lot of early editor prototypes store a floor plan like a drawing app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Stroke {
  points: [(x,y)...]   // freehand or snapped
  thickness
  layer
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is fine for PNG export. It is a bad source of truth for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exact segment lengths the user can edit (&lt;code&gt;4.20 m&lt;/code&gt; vs a string that used to mean feet),&lt;/li&gt;
&lt;li&gt;doors and windows that must live &lt;em&gt;on&lt;/em&gt; a wall, not float near one,&lt;/li&gt;
&lt;li&gt;room area that must change when you drag a corner,&lt;/li&gt;
&lt;li&gt;multi-floor / duplicate-option trees that must not corrupt shared geometry,&lt;/li&gt;
&lt;li&gt;DXF / SVG / PDF-with-scale exports that expect closed polylines and layers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Strokes are a view. Topology is the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Walls are edges; corners are vertices
&lt;/h2&gt;

&lt;p&gt;The minimum durable shape I want for an interactive plan looks closer to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vertex {
  id
  x, y                 // canonical unit: meters in model space
  incident_wall_ids[]
}

Wall {
  id
  v_a, v_b             // ordered endpoints
  thickness?
  openings[]           // doors/windows as parametric offsets along the edge
}

RoomCandidate / Room {
  id
  cycle: WallId[]      // oriented walk that closes
  area_m2              // derived, never user-authored as primary
  label?
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hotkeys like &lt;code&gt;W&lt;/code&gt; (wall) and &lt;code&gt;R&lt;/code&gt; (room) map cleanly onto that model: &lt;code&gt;W&lt;/code&gt; inserts or splits edges; &lt;code&gt;R&lt;/code&gt; asks the topology layer to find or confirm a closed cycle and materialize a room. The UI can still look like "click, drag, type a length." Underneath, length is &lt;code&gt;|v_b - v_a|&lt;/code&gt; in the canonical unit, then formatted for display as meters &lt;em&gt;or&lt;/em&gt; feet-inches. Display strings are not the geometry contract.&lt;/p&gt;

&lt;p&gt;That last sentence matters more than it sounds. If you store &lt;code&gt;"12' 6\""&lt;/code&gt; as the wall length and re-parse it later, rounding and locale bugs become structural. Store meters (or another single SI-like unit) in the model; format on the way out; parse on the way in with an explicit unit mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing a loop is a graph problem
&lt;/h2&gt;

&lt;p&gt;When a user draws three walls of a rectangle and then the fourth, you do not "paint a fill." You need a closed walk:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Snap the new endpoint onto an existing vertex within a tolerance (or create a vertex and merge later).&lt;/li&gt;
&lt;li&gt;Insert the wall edge.&lt;/li&gt;
&lt;li&gt;Run a local cycle search from the touched vertices (faces of a planar embedding, or a constrained walk along wall directions).&lt;/li&gt;
&lt;li&gt;If a simple cycle appears, attach a &lt;code&gt;Room&lt;/code&gt; whose &lt;code&gt;cycle&lt;/code&gt; owns those walls in order.&lt;/li&gt;
&lt;li&gt;Recompute area from the ordered vertex ring.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the fourth wall stops 2 cm short of the corner because snap failed, you do not have a room — you have a dangling edge. Showing a pastel fill anyway is how you lie about area. Better UX: keep the incomplete chain visible, refuse &lt;code&gt;R&lt;/code&gt; (or mark the candidate as open), and tell the user which gap is still open. Coral dangling edges beat fake closed polygons.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flnknmd554xlnf8a1929j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flnknmd554xlnf8a1929j.jpg" alt="Floor plan as graph — vertices, wall edges, room loops, and shoelace area in a topology model" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Area is derived: shoelace, not a text field
&lt;/h2&gt;

&lt;p&gt;Once you have an ordered ring of vertices &lt;code&gt;(x_i, y_i)&lt;/code&gt; in meters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;area = 1/2 * |Σ (x_i * y_{i+1} - x_{i+1} * y_i)|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with &lt;code&gt;y_{n+1} = y_1&lt;/code&gt;. That is the shoelace formula. A few contracts I treat as non-negotiable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Orientation.&lt;/strong&gt; Store cycle winding consistently (e.g. CCW for interior rooms). If a boolean subtracts a courtyard, winding encodes the sign.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared walls.&lt;/strong&gt; Two adjacent rooms share a wall id, not a duplicated segment with slightly different coordinates. Dragging the shared edge updates both areas from the same vertices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Openings do not change floor area.&lt;/strong&gt; A door on a wall is an attribute of the edge (offset, width, swing). It may affect circulation analysis later; it must not punch a hole in the room polygon unless you explicitly model that (you almost never should for furniture-layout plans).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never persist &lt;code&gt;area_m2&lt;/code&gt; as editable primary state.&lt;/strong&gt; Cache it, sure. Invalidate on any vertex move that touches the cycle. If export needs square feet, convert at the boundary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Auto room areas in a maker tool are only trustworthy if they are this kind of derived quantity. A label someone typed in a property panel will drift the first time a corner moves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snap, split, and merge: the unglamorous correctness layer
&lt;/h2&gt;

&lt;p&gt;Interactive editors die on vertex hygiene:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Snap to vertex / snap to edge.&lt;/strong&gt; Creating a T-junction must &lt;em&gt;split&lt;/em&gt; the existing wall into two colinear edges that share the new vertex. If you only visually snap and leave one long edge underneath, doors parametric-on-edge and cycle search both lie.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge colinear walls.&lt;/strong&gt; After a delete, two edges that became colinear with degree-2 middle vertex should collapse — or you accumulate junk vertices that break "exact length" editing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tolerance policy.&lt;/strong&gt; Screen-pixel snap and model-space snap are different. Decide a model epsilon (e.g. a few millimeters) independent of zoom, then a separate screen tolerance for hit-testing. Mixing them is how zoomed-out clicks invent 3 cm gaps that look closed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is glamorous. All of it decides whether "exact lengths" and "room areas auto" are real features or marketing copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosted geometry: doors, windows, furniture
&lt;/h2&gt;

&lt;p&gt;A free maker that advertises large catalogs — thousands of furniture items, dozens of doors, many windows — still has a simple hosting rule:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Object&lt;/th&gt;
&lt;th&gt;Host&lt;/th&gt;
&lt;th&gt;Parameterization&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Door / window&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Wall&lt;/code&gt; edge&lt;/td&gt;
&lt;td&gt;offset along edge, width, side/swing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Furniture&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Room&lt;/code&gt; (or floor slab)&lt;/td&gt;
&lt;td&gt;pose in room-local or world XY, optional snap to walls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dimension label&lt;/td&gt;
&lt;td&gt;derived from edge&lt;/td&gt;
&lt;td&gt;never authoritative&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Hit-testing then becomes staged: first spatial index over wall AABBs and furniture AABBs; then refine to edge parameter or furniture local bounds. You do not need a exotic index on day one, but you do need &lt;em&gt;some&lt;/em&gt; index once the scene is dense — a flat array of 4000 furniture hits on every pointer move will feel wrong even if you never publish a benchmark.&lt;/p&gt;

&lt;p&gt;The important architectural point: &lt;strong&gt;openings are not free polygons in the same bag as walls.&lt;/strong&gt; If a door is just another stroke, moving the wall does not move the door, and DXF layers become archaeology.&lt;/p&gt;

&lt;h2&gt;
  
  
  Options and floors without corrupting shared geometry
&lt;/h2&gt;

&lt;p&gt;Duplicate layout options and multi-floor plans tempt a shallow &lt;code&gt;deepcopy&lt;/code&gt; of the whole document. That works until two options were supposed to share a core shell, or until an undo stack aliases a vertex id across forks.&lt;/p&gt;

&lt;p&gt;A pattern that stays sane:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Document {
  vertex_pool: map id -&amp;gt; Vertex
  floors: map floor_id -&amp;gt; Floor
  options: map option_id -&amp;gt; OptionRef  // points at a floor graph revision
}

FloorGraphRevision {
  walls, rooms, placements
  parent_revision?
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Duplicating an option clones the revision (copy-on-write if you are ambitious; deep copy of the graph if you are honest and small). It must mint new wall/room ids or carefully namespace them so edits in option B cannot mutate option A's cycles. Multi-floor is the same idea on the Z axis: each floor has its own graph; vertical alignment is a &lt;em&gt;constraint between graphs&lt;/em&gt;, not one mashed coordinate space with overlapping ids.&lt;/p&gt;

&lt;p&gt;If you skip revision identity, "duplicate" becomes "alias," and the first shared drag corrupts both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Export is a consumer of topology, not a second editor
&lt;/h2&gt;

&lt;p&gt;PNG/SVG at SD/HD/4K, PDF with paper size and scale, and DXF are different projections of the same graph:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Raster / SVG (visual):&lt;/strong&gt; stroke walls, fill room cycles, draw furniture sprites, respect color vs B&amp;amp;W mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDF with scale:&lt;/strong&gt; same geometry plus a scale bar derived from model meters → paper units. If the cycle is wrong, the scale bar makes the lie official.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DXF:&lt;/strong&gt; layers for walls, openings, furniture; polylines from room cycles; units declared once. Exporters should walk &lt;code&gt;Wall&lt;/code&gt;/&lt;code&gt;Room&lt;/code&gt; — not re-trace pixels from a canvas bitmap.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trace-a-plan (upload underlay) fits as a &lt;em&gt;background image with its own transform&lt;/em&gt;, not as walls. Vectorization into walls is a separate pipeline; until edges exist in the graph, you still do not have rooms.&lt;/p&gt;

&lt;p&gt;Lock modes are just permissions on mutations: lock vertices / walls / placements so hit-testing still works but commits no-op. They do not change the topology contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical checklist before you trust "auto area"
&lt;/h2&gt;

&lt;p&gt;When I review an editor path — ours or anyone's — I ask:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Is there a single canonical unit in model space?&lt;/li&gt;
&lt;li&gt;Does inserting a T-junction split the wall edge in the data model?&lt;/li&gt;
&lt;li&gt;Can I point to the cycle (ordered wall ids) for every room that shows an area?&lt;/li&gt;
&lt;li&gt;Does dragging a shared vertex recompute both adjacent areas without a manual refresh?&lt;/li&gt;
&lt;li&gt;Are doors/windows parameterized on walls, so wall moves carry them?&lt;/li&gt;
&lt;li&gt;Does duplicate-option create a new graph revision instead of aliasing ids?&lt;/li&gt;
&lt;li&gt;Do DXF/SVG exporters read topology, or do they scrape the canvas?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If any answer is "we fake it in the renderer," area is a rumor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this belongs next to a real maker
&lt;/h2&gt;

&lt;p&gt;Product surfaces that expose templates (apartments, offices, restaurants, single rooms), catalogs of furniture/doors/windows, exact length entry, auto room areas, duplicate options, multi-floor, and serious export formats only stay coherent if the scene is a graph with closed cycles. The UI can stay approachable — keyboard &lt;code&gt;W&lt;/code&gt; / &lt;code&gt;R&lt;/code&gt;, snap, lock, trace underlay — while the model stays strict.&lt;/p&gt;

&lt;p&gt;That is the systems habit I care about: &lt;strong&gt;make the interactive floor-plan editor's truth the same truth the exporter and the area label read.&lt;/strong&gt; Everything else is chrome.&lt;/p&gt;

&lt;p&gt;If you are building something in this shape, start with vertices, walls, and cycle detection. Add catalogs and pretty fills after the loops close without lying.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>architecture</category>
      <category>webdev</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Don't Run Floor-Plan Generation on the Request Thread</title>
      <dc:creator>Tomás Herrera</dc:creator>
      <pubDate>Tue, 03 Nov 2026 05:41:41 +0000</pubDate>
      <link>https://dev.to/linnn_charm_2e397112f3b51/dont-run-floor-plan-generation-on-the-request-thread-29ff</link>
      <guid>https://dev.to/linnn_charm_2e397112f3b51/dont-run-floor-plan-generation-on-the-request-thread-29ff</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F62yoni18jqilebz9or1g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F62yoni18jqilebz9or1g.jpg" alt="Don't Run Floor-Plan Generation on the Request Thread — OGP tech card about queues, retries, and idempotency" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm Tomás Herrera. Day job is backend and infrastructure at ArchyBase — mostly the unglamorous path from an uploaded image to a finished artifact: preprocess, enqueue, watch workers, surface honest failures. This post is about a sibling product our team also builds, &lt;a href="https://www.floorai.ai/" rel="noopener noreferrer"&gt;FloorAI&lt;/a&gt;, and specifically why floor-plan generation should not sit on the HTTP request thread. The case study is the &lt;a href="https://www.floorai.ai/ai-floor-plan-optimizer" rel="noopener noreferrer"&gt;floor plan optimizer that keeps hard constraints&lt;/a&gt;: upload a plan, declare what must not move, wait for a revised layout.&lt;/p&gt;

&lt;p&gt;I'm not claiming a magic latency number or a user count. I'm claiming an architecture habit that keeps timeouts, retries, and bad days from corrupting your data model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The request thread is a terrible place for generation
&lt;/h2&gt;

&lt;p&gt;A typical naive path looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Client &lt;code&gt;POST&lt;/code&gt;s an image (or a structured plan) plus constraint payload.&lt;/li&gt;
&lt;li&gt;API handler runs preprocess → model / solver → postprocess.&lt;/li&gt;
&lt;li&gt;Handler returns the finished floor plan in the same response.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That works in a demo with a warm cache and a friendly network. It fails in production for boring reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gateway and load-balancer idle timeouts&lt;/strong&gt; sit in the 30–120s range more often than product people expect. Generation that sometimes takes longer simply never reaches the client as a 200.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client retries&lt;/strong&gt; on a hung connection are not the same as server-side idempotency. Without a job id, a double submit becomes two generations and two writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Worker memory and GPU / CPU pools&lt;/strong&gt; do not scale like stateless web replicas. Pinning that work to the request fleet couples traffic spikes to the most expensive path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the first design rule I push for: &lt;strong&gt;accept work quickly, run generation elsewhere, expose status honestly&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What “queued” means in this product shape
&lt;/h2&gt;

&lt;p&gt;For an optimizer-style flow, the durable unit of work is not “the HTTP call.” It is something closer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Job {
  job_id          // client-visible, unique
  input_ref       // uploaded plan / image object key
  constraints     // hard constraints: walls, openings, adjacency
  state           // queued | running | succeeded | failed | cancelled
  attempt         // monotonic
  result_ref?     // output object key when succeeded
  error_class?    // timeout | invalid_input | solver_infeasible | internal
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The upload+constraints request should:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validate enough to reject garbage early (empty file, unsupported type, constraints that contradict each other in an obvious way).&lt;/li&gt;
&lt;li&gt;Persist the input and create the job in &lt;code&gt;queued&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Return &lt;code&gt;202&lt;/code&gt; (or an equivalent “accepted” payload) with &lt;code&gt;job_id&lt;/code&gt; and a status URL.&lt;/li&gt;
&lt;li&gt;Let a worker claim the job, run generation, and transition state.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The optimizer page’s product promise — keep hard constraints while revising circulation or room use — maps cleanly onto that model. Constraints are part of the job payload, not ambient session state. If the tab closes, the job still exists. If the user refreshes, they reattach by &lt;code&gt;job_id&lt;/code&gt;, not by hoping the old TCP connection is alive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeouts belong to stages, not to “the whole thing”
&lt;/h2&gt;

&lt;p&gt;One timeout for “upload to finished plan” hides where time went. I prefer stage budgets:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Typical failure mode&lt;/th&gt;
&lt;th&gt;Client-visible consequence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Upload / ingest&lt;/td&gt;
&lt;td&gt;oversized file, virus scan stall&lt;/td&gt;
&lt;td&gt;reject before queue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Preprocess&lt;/td&gt;
&lt;td&gt;decode failure, absurd aspect ratio&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;failed&lt;/code&gt; + &lt;code&gt;invalid_input&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generation / solve&lt;/td&gt;
&lt;td&gt;soft time budget exceeded&lt;/td&gt;
&lt;td&gt;retryable &lt;code&gt;timeout&lt;/code&gt; or &lt;code&gt;solver_infeasible&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persist / notify&lt;/td&gt;
&lt;td&gt;object store blip&lt;/td&gt;
&lt;td&gt;retry without re-solving if result already written&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The important part is &lt;strong&gt;which failures are safe to retry&lt;/strong&gt;. A pure timeout with no side effects is usually retryable. A solver that already wrote a partial artifact needs an idempotency key so a retry does not append a second “final” plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retries without doubles
&lt;/h2&gt;

&lt;p&gt;Idempotency for generation jobs is not optional once you leave the request thread. Minimum bar:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client may send an &lt;code&gt;Idempotency-Key&lt;/code&gt; (or you mint &lt;code&gt;job_id&lt;/code&gt; server-side and require the client to reuse it on reconnect).&lt;/li&gt;
&lt;li&gt;Worker claim uses compare-and-set: only one worker moves &lt;code&gt;queued → running&lt;/code&gt; for a given attempt.&lt;/li&gt;
&lt;li&gt;Result write is keyed by &lt;code&gt;job_id&lt;/code&gt;. Succeeded stays succeeded; a late worker must not overwrite with a second blob unless you explicitly version outputs.&lt;/li&gt;
&lt;li&gt;User-facing “Try again” creates a &lt;strong&gt;new attempt&lt;/strong&gt; (or a new job) rather than mutating history in place — so support can see what ran.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Silent auto-retries on &lt;code&gt;invalid_input&lt;/code&gt; waste money and confuse people. Auto-retries on transient infra errors are fine if the attempt counter and backoff are visible in logs and, ideally, in the status payload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest failure states beat a spinner that lies
&lt;/h2&gt;

&lt;p&gt;UI that spins until the gateway kills the connection teaches users the wrong lesson. Prefer a small, boring state machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;queued&lt;/strong&gt; — accepted; position / ETA optional and best-effort only (don’t invent precision).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;running&lt;/strong&gt; — a worker holds the lease.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;succeeded&lt;/strong&gt; — &lt;code&gt;result_ref&lt;/code&gt; is readable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;failed&lt;/strong&gt; — with an &lt;code&gt;error_class&lt;/code&gt; the client can branch on (&lt;code&gt;invalid_input&lt;/code&gt; vs retryable).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cancelled&lt;/strong&gt; — user or system stopped it; not the same as failed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For constraint-heavy optimization, &lt;code&gt;solver_infeasible&lt;/code&gt; deserves its own class. “We could not satisfy these hard constraints together” is a different product conversation from “the GPU node disappeared.” Collapsing both into a red toast sends people into pointless retries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc0lidelp71g0s2icbg5g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc0lidelp71g0s2icbg5g.jpg" alt="Infrastructure desk with a job-queue dashboard on one monitor and a floor-plan thumbnail on the other, terminal showing worker logs" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost vs latency, without fake metrics
&lt;/h2&gt;

&lt;p&gt;Queued generation lets you choose where to spend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Latency-sensitive path:&lt;/strong&gt; smaller input, tighter preprocess, higher-priority queue for interactive edits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost-sensitive path:&lt;/strong&gt; batch queue, lower concurrency, accept longer &lt;code&gt;queued&lt;/code&gt; time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I won’t quote unverified speedups. The architectural win is control: you can shed load by refusing new jobs with a clear &lt;code&gt;queued&lt;/code&gt;-capacity response instead of letting request threads pile up until everything 504s. You can also keep hard constraints attached to the job so a cheap retry does not drop the user’s “these walls stay” rules — which is the whole point of an optimizer that claims to respect them.&lt;/p&gt;

&lt;h2&gt;
  
  
  A minimal checklist before you ship “AI floor plan” on HTTP
&lt;/h2&gt;

&lt;p&gt;If you’re wiring something like FloorAI’s optimizer flow (or any sibling generation API), I use this as a gate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;invariant generation_off_request_thread:
  accept() returns job_id quickly
  generation runs only in workers with lease + attempt
  every terminal state is one of {succeeded, failed, cancelled}
  failed always carries error_class
  retries never create a second succeeded result for the same job_id
  hard constraints travel with the job, not with the browser tab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;p&gt;Floor-plan generation — especially optimization under hard constraints — is asynchronous work wearing a synchronous costume if you leave it on the request thread. Move it to a job: durable &lt;code&gt;job_id&lt;/code&gt;, staged timeouts, idempotent retries, and failure classes humans can act on. ArchyBase’s day job taught me that the boring state machine is what keeps the flashy model from lying to the user. FloorAI’s upload-and-constrain optimizer is a good reminder of the same rule: keep the walls where the user said they stay, and keep the HTTP thread free so you can tell them the truth when the solve does not.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>webdev</category>
      <category>architecture</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How I Built an AI Design Platform That Renders Professional Architectural Visuals in Under 10 Seconds</title>
      <dc:creator>Tomás Herrera</dc:creator>
      <pubDate>Fri, 22 May 2026 13:19:34 +0000</pubDate>
      <link>https://dev.to/linnn_charm_2e397112f3b51/how-i-built-an-ai-design-platform-that-renders-professional-architectural-visuals-in-under-10-2nm5</link>
      <guid>https://dev.to/linnn_charm_2e397112f3b51/how-i-built-an-ai-design-platform-that-renders-professional-architectural-visuals-in-under-10-2nm5</guid>
      <description>&lt;p&gt;The first time I showed a client a photorealistic render generated from their hand-drawn napkin sketch in under ten seconds, they thought I had a team of 3D artists on standby. I didn't. It was a single API call.&lt;/p&gt;

&lt;p&gt;This post is about the technical decisions, the architecture choices, and the lessons learned building &lt;strong&gt;&lt;a href="https://www.archybase.com/" rel="noopener noreferrer"&gt;archybase.com&lt;/a&gt;&lt;/strong&gt; — an all-in-one AI platform for interior design, exterior visualization, landscape generation, and sketch-to-render workflows.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Space
&lt;/h2&gt;

&lt;p&gt;Architectural visualization has always been expensive. A single high-quality 3D render from a professional studio costs anywhere from $300 to $1,500 and takes 48–72 hours. For interior designers iterating on client preferences, that feedback loop is brutal. For homeowners trying to visualize a renovation before committing a six-figure budget, it's simply inaccessible.&lt;/p&gt;

&lt;p&gt;AI image generation changed the equation — but raw diffusion models like Stable Diffusion, Midjourney, or DALL·E are not purpose-built for architectural use cases. They hallucinate furniture, distort spatial proportions, and misinterpret structural elements. You get beautiful chaos, not professional renders.&lt;/p&gt;

&lt;p&gt;The technical challenge was: &lt;strong&gt;how do you constrain generative AI to produce architecturally accurate, style-consistent, spatially coherent outputs, at scale, with sub-10-second latency?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Core Architecture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Rendering Pipeline
&lt;/h3&gt;

&lt;p&gt;The generation pipeline runs on a custom fine-tuned diffusion model with ControlNet conditioning. ControlNet is the key ingredient here — it allows the model to receive a structural "control signal" (depth maps, edge maps, pose maps) alongside the text prompt, so spatial layout is preserved even when the style is completely transformed.&lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;Sketch to Render&lt;/strong&gt; workflow, the pipeline looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User uploads a sketch or CAD drawing&lt;/li&gt;
&lt;li&gt;Edge detection extracts the structural skeleton (Canny + HED)&lt;/li&gt;
&lt;li&gt;ControlNet feeds the edge map as a hard constraint&lt;/li&gt;
&lt;li&gt;The diffusion model generates a photorealistic render that respects the original structure&lt;/li&gt;
&lt;li&gt;Post-processing upscales to 4K via a Real-ESRGAN step&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For room redesign (the core &lt;a href="https://www.archybase.com/ai-interior-design" rel="noopener noreferrer"&gt;AI Interior Design&lt;/a&gt; flow), we use a depth-conditioned ControlNet variant that preserves spatial relationships while completely replacing surface materials, furniture, and lighting.&lt;/p&gt;

&lt;h3&gt;
  
  
  Infrastructure Choices
&lt;/h3&gt;

&lt;p&gt;The rendering workload runs on GPU clusters (NVIDIA A100s for high-res generation, T4s for standard tier). The stack is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 15&lt;/strong&gt; (App Router) for the frontend and API routes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Railway&lt;/strong&gt; for containerized deployment of the rendering service&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare R2&lt;/strong&gt; for storing input images and output renders at scale&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prisma + PostgreSQL&lt;/strong&gt; for user state, generation history, and subscription management&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe&lt;/strong&gt; for subscription billing (Starter / Plus / Pro tiers)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One non-obvious lesson: &lt;strong&gt;GPU cold starts are brutal for UX.&lt;/strong&gt; When a GPU instance scales down to zero and then has to spin back up, you're looking at 30–60 second startup times. We solved this by keeping a minimum number of warm instances running during peak hours and implementing optimistic UI patterns to mask perceived latency.&lt;/p&gt;

&lt;h3&gt;
  
  
  The ControlNet Selection Problem
&lt;/h3&gt;

&lt;p&gt;Different design tasks require different control modalities:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;ControlNet Type&lt;/th&gt;
&lt;th&gt;Control Signal&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Sketch to Render&lt;/td&gt;
&lt;td&gt;Canny / HED&lt;/td&gt;
&lt;td&gt;Edge maps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Room Redesign&lt;/td&gt;
&lt;td&gt;Depth&lt;/td&gt;
&lt;td&gt;Depth maps from MiDaS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exterior Facade&lt;/td&gt;
&lt;td&gt;Segmentation&lt;/td&gt;
&lt;td&gt;Semantic masks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Landscape Design&lt;/td&gt;
&lt;td&gt;Tile + Depth&lt;/td&gt;
&lt;td&gt;Layout tiles + depth&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Choosing the wrong ControlNet for a task is the single biggest source of output quality degradation. We built a task classifier that automatically selects the appropriate conditioning pipeline based on the input type and user intent.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Landscape Design Challenge
&lt;/h2&gt;

&lt;p&gt;Of all the product surfaces, the &lt;a href="https://www.archybase.com/ai-landscape-design" rel="noopener noreferrer"&gt;AI Landscape Design&lt;/a&gt; tool presented the most unique engineering challenges.&lt;/p&gt;

&lt;p&gt;Landscape outputs are inherently &lt;strong&gt;seasonal and temporal&lt;/strong&gt; — the same garden looks completely different in summer versus autumn versus winter. We needed the model to understand not just spatial layout but lighting direction, foliage density, and seasonal color palettes.&lt;/p&gt;

&lt;p&gt;We solved this with a two-stage approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A scene graph generator that parses the input photo and produces a structured layout (hardscape vs. softscape vs. water features vs. structures)&lt;/li&gt;
&lt;li&gt;A conditioning stack that combines depth maps with the scene graph labels to give the model explicit semantic information about what each region of the image represents&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result is that when a user says "transform this backyard into a Japanese zen garden in autumn," the model knows which parts of the image are plantable, which are hardscape, and which are architectural — so it doesn't try to grow moss on a swimming pool.&lt;/p&gt;




&lt;h2&gt;
  
  
  SEO as a Growth Channel
&lt;/h2&gt;

&lt;p&gt;One thing I want to be transparent about for other indie developers: &lt;strong&gt;organic search is the backbone of early-stage SaaS growth if you're not paying for ads.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We built a programmatic SEO content matrix around the core value propositions — room types × design styles × use cases. Each combination (e.g., "Scandinavian modern living room AI render") gets a dedicated landing page with schema markup, proper breadcrumbs, and semantically rich content.&lt;/p&gt;

&lt;p&gt;The architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic routes in Next.js (&lt;code&gt;/ai-[room]-design&lt;/code&gt;, &lt;code&gt;/[style]-[space]-render&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;JSON-LD structured data (HowTo, Product, BreadcrumbList schemas)&lt;/li&gt;
&lt;li&gt;GSC + Plausible for measuring organic traffic and conversion rates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It took about 4 months to see meaningful organic traction, but now roughly 60% of new signups come through organic search.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pricing Architecture
&lt;/h2&gt;

&lt;p&gt;We run three paid tiers (Starter, Plus, Professional) with generation credits as the primary consumption unit. A key architectural decision was &lt;strong&gt;separating standard and "pro" generation credits&lt;/strong&gt; — standard credits use the T4-based pipeline with faster but slightly lower quality outputs; pro credits use A100s with enhanced upscaling, longer inference steps, and higher coherence.&lt;/p&gt;

&lt;p&gt;This lets price-sensitive users still get real value at the entry tier while giving power users (professional architects, real estate agents) a clear reason to upgrade.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;The roadmap includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Floor Plan Generator&lt;/strong&gt; (currently in beta) — generating 2D floor plans from text descriptions and converting them to 3D walkthroughs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video rendering&lt;/strong&gt; — we already have a Remotion-based video rendering service running with GPU-accelerated EGL for generating animated flythrough renders&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration features&lt;/strong&gt; — shared project workspaces for architect-client collaboration&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building a production-grade AI image generation product is not just a machine learning problem — it's an infrastructure problem, a product problem, and a UX problem simultaneously. The model quality sets your ceiling, but cold start latency, credit economics, and the clarity of your user workflow determine whether people actually stick around.&lt;/p&gt;

&lt;p&gt;If you're curious about the product or want to explore what AI-native architectural visualization looks like in practice, check out &lt;strong&gt;&lt;a href="https://www.archybase.com/" rel="noopener noreferrer"&gt;archybase.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmjzb18n3sz8689vkdjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmjzb18n3sz8689vkdjl.png" alt="Exterior design" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>interior</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Gemma 4 Complete Guide: Architecture, Models, and Deployment in 2026</title>
      <dc:creator>Tomás Herrera</dc:creator>
      <pubDate>Sun, 05 Apr 2026 01:14:14 +0000</pubDate>
      <link>https://dev.to/linnn_charm_2e397112f3b51/gemma-4-complete-guide-architecture-models-and-deployment-in-2026-3m5b</link>
      <guid>https://dev.to/linnn_charm_2e397112f3b51/gemma-4-complete-guide-architecture-models-and-deployment-in-2026-3m5b</guid>
      <description>&lt;p&gt;Google DeepMind released Gemma 4 on April 3, 2026 under Apache 2.0 — &lt;br&gt;
a significant licensing shift from previous Gemma releases that makes &lt;br&gt;
it genuinely usable for commercial products without legal ambiguity.&lt;/p&gt;

&lt;p&gt;This guide covers the full model family, architecture decisions worth &lt;br&gt;
understanding, and practical deployment paths across cloud, local, &lt;br&gt;
and mobile.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Four Models and When to Use Each
&lt;/h2&gt;

&lt;p&gt;Gemma 4 ships in four sizes with meaningfully different architectures:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Params&lt;/th&gt;
&lt;th&gt;Active&lt;/th&gt;
&lt;th&gt;Architecture&lt;/th&gt;
&lt;th&gt;VRAM (4-bit)&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;E2B&lt;/td&gt;
&lt;td&gt;~2.3B&lt;/td&gt;
&lt;td&gt;all&lt;/td&gt;
&lt;td&gt;Dense + PLE&lt;/td&gt;
&lt;td&gt;~2GB&lt;/td&gt;
&lt;td&gt;Mobile / edge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;E4B&lt;/td&gt;
&lt;td&gt;~4.5B&lt;/td&gt;
&lt;td&gt;all&lt;/td&gt;
&lt;td&gt;Dense + PLE&lt;/td&gt;
&lt;td&gt;~3.6GB&lt;/td&gt;
&lt;td&gt;Laptop / tablet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26B A4B&lt;/td&gt;
&lt;td&gt;25.2B&lt;/td&gt;
&lt;td&gt;3.8B&lt;/td&gt;
&lt;td&gt;MoE&lt;/td&gt;
&lt;td&gt;~16GB&lt;/td&gt;
&lt;td&gt;Consumer GPU&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31B&lt;/td&gt;
&lt;td&gt;30.7B&lt;/td&gt;
&lt;td&gt;all&lt;/td&gt;
&lt;td&gt;Dense&lt;/td&gt;
&lt;td&gt;~18GB&lt;/td&gt;
&lt;td&gt;Workstation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The E2B result is the most surprising: multiple community benchmarks &lt;br&gt;
confirm it outperforms Gemma 3 27B on several tasks despite being &lt;br&gt;
12x smaller in effective parameter count.&lt;/p&gt;
&lt;h2&gt;
  
  
  Architecture: What's Actually Different
&lt;/h2&gt;
&lt;h3&gt;
  
  
  MoE vs Dense
&lt;/h3&gt;

&lt;p&gt;The 26B A4B is a Mixture-of-Experts model. Despite 25.2B total &lt;br&gt;
parameters, only 3.8B activate per token during inference. This means &lt;br&gt;
self-hosting it requires significantly less VRAM than a comparable &lt;br&gt;
dense model — closer to running a 4B model than a 26B one.&lt;/p&gt;

&lt;p&gt;Gemma's MoE implementation differs from DeepSeek and Qwen: instead of &lt;br&gt;
replacing MLP blocks with sparse experts, Gemma adds MoE blocks as &lt;br&gt;
separate layers alongside the standard MLP blocks and sums their &lt;br&gt;
outputs. This is an unusual design choice that trades some efficiency &lt;br&gt;
for architectural simplicity.&lt;/p&gt;
&lt;h3&gt;
  
  
  Per-Layer Embeddings (PLE) in Edge Models
&lt;/h3&gt;

&lt;p&gt;The E2B and E4B use PLE instead of MoE — a different efficiency &lt;br&gt;
strategy suited for mobile inference. Standard transformers give each &lt;br&gt;
token a single embedding vector at input. PLE adds a parallel &lt;br&gt;
lower-dimensional conditioning pathway: for each token, it produces &lt;br&gt;
a small dedicated vector per layer, letting each decoder layer receive &lt;br&gt;
token-specific information only when relevant rather than requiring &lt;br&gt;
everything to be frontloaded into a single embedding.&lt;/p&gt;

&lt;p&gt;This is what enables E2B to run under 1.5GB RAM on supported mobile &lt;br&gt;
devices via LiteRT-LM.&lt;/p&gt;
&lt;h3&gt;
  
  
  Hybrid Attention
&lt;/h3&gt;

&lt;p&gt;All Gemma 4 models use alternating local sliding-window and global &lt;br&gt;
full-context attention layers. Smaller models use 512-token sliding &lt;br&gt;
windows, larger ones use 1024. The final layer is always global.&lt;/p&gt;

&lt;p&gt;For KV cache optimization, global layers share key-value states from &lt;br&gt;
earlier layers (Shared KV Cache), eliminating redundant KV projections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Known issue:&lt;/strong&gt; The KV cache footprint at long context is substantial. &lt;br&gt;
Community reports indicate the 31B at 262K context requires ~22GB just &lt;br&gt;
for KV cache on top of the model weight. Workaround: &lt;br&gt;
&lt;code&gt;--ctx-size 8192 --cache-type-k q4_0 --parallel 1&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Context Windows and Multimodal Capabilities
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;E2B / E4B&lt;/th&gt;
&lt;th&gt;26B A4B / 31B&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;128K&lt;/td&gt;
&lt;td&gt;256K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image input&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Video input&lt;/td&gt;
&lt;td&gt;✅ (60s @ 1fps)&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Audio input&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Function calling&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Audio input is edge-model only — E2B and E4B support ASR and &lt;br&gt;
speech-to-translated-text via a USM-style conformer encoder.&lt;/p&gt;
&lt;h2&gt;
  
  
  Local Deployment
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Ollama (fastest to get running)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# E4B — recommended for most laptops&lt;/span&gt;
ollama pull gemma4:e4b
ollama run gemma4:e4b

&lt;span class="c"&gt;# 26B A4B — needs 16GB+ VRAM&lt;/span&gt;
ollama pull gemma4:26b-a4b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Note: requires Ollama 0.20 or newer for Gemma 4 support.&lt;/p&gt;
&lt;h3&gt;
  
  
  llama.cpp
&lt;/h3&gt;

&lt;p&gt;A tokenizer fix was merged into the main branch shortly after launch. &lt;br&gt;
Pull the latest and recompile before running Gemma 4 GGUF files.&lt;/p&gt;
&lt;h3&gt;
  
  
  Apple Silicon (MLX)
&lt;/h3&gt;

&lt;p&gt;Unsloth MLX builds use ~40% less memory than Ollama at the cost of &lt;br&gt;
~15-20% lower token throughput. For memory-constrained setups:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;mlx-lm
mlx_lm.generate &lt;span class="nt"&gt;--model&lt;/span&gt; unsloth/gemma-4-e4b-it-mlx &lt;span class="nt"&gt;--prompt&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  LM Studio
&lt;/h3&gt;

&lt;p&gt;Search "gemma4" in the model browser. E4B and 26B A4B are available &lt;br&gt;
as pre-quantized GGUF files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mobile Deployment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Android
&lt;/h3&gt;

&lt;p&gt;Android has the most complete official on-device story:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Google AI Edge Gallery&lt;/strong&gt; — install from Play Store, 
select Gemma 4 E2B or E4B, runs fully on-device&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LiteRT-LM&lt;/strong&gt; — for developers building their own apps, 
gets E2B under 1.5GB RAM with 2-bit and 4-bit quantization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ML Kit GenAI Prompt API&lt;/strong&gt; — production-ready API for 
Android app integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android AICore&lt;/strong&gt; — system-wide optimized Gemma 4 access 
on supported Android 10+ devices&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  iOS
&lt;/h3&gt;

&lt;p&gt;iOS is currently a developer integration story, not a consumer one. &lt;br&gt;
The official path is MediaPipe LLM Inference SDK. No App Store &lt;br&gt;
consumer app with Gemma 4 exists yet.&lt;/p&gt;

&lt;p&gt;A practical reference for both Android and iOS deployment paths &lt;br&gt;
is available at &lt;a href="https://gemma4.app/mobile" rel="noopener noreferrer"&gt;gemma4.app/mobile&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud Deployment
&lt;/h2&gt;

&lt;p&gt;Google offers three official cloud paths:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vertex AI&lt;/strong&gt; — managed deployment with autoscaling, best for &lt;br&gt;
production workloads requiring SLA guarantees.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloud Run&lt;/strong&gt; — serverless container deployment, lower operational &lt;br&gt;
overhead, suitable for moderate traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Google Kubernetes Engine (GKE)&lt;/strong&gt; — vLLM on GKE for high-throughput &lt;br&gt;
serving, best for teams already running Kubernetes infrastructure.&lt;/p&gt;

&lt;p&gt;For API access without self-hosting, the 26B A4B is available via &lt;br&gt;
OpenRouter at $0.13/M input tokens and $0.40/M output tokens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benchmark Context
&lt;/h2&gt;

&lt;p&gt;The 31B dense model ranks #3 among open models on Arena AI as of &lt;br&gt;
launch. Key numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AIME 2026: 89.2% (31B with reasoning)&lt;/li&gt;
&lt;li&gt;GPQA Diamond: 85.7%&lt;/li&gt;
&lt;li&gt;LiveCodeBench v6: 80.0%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The ELO gap vs automated benchmarks is notable: the 31B scores &lt;br&gt;
higher on human preference rankings (Arena) than raw benchmark &lt;br&gt;
comparisons with Qwen 3.5 27B would suggest, indicating the model &lt;br&gt;
produces outputs humans prefer even when accuracy is similar.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fine-tuning Status
&lt;/h2&gt;

&lt;p&gt;QLoRA fine-tuning tooling was not ready at launch. Three issues &lt;br&gt;
were reported within the first 24 hours:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HuggingFace Transformers didn't recognize the gemma4 architecture 
(required installing from source initially)&lt;/li&gt;
&lt;li&gt;PEFT couldn't handle &lt;code&gt;Gemma4ClippableLinear&lt;/code&gt;, a new layer type 
in the vision encoder&lt;/li&gt;
&lt;li&gt;A new &lt;code&gt;mm_token_type_ids&lt;/code&gt; field is required during training even 
for text-only data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both &lt;code&gt;huggingface/peft&lt;/code&gt; and &lt;code&gt;huggingface/transformers&lt;/code&gt; issues have &lt;br&gt;
been filed. Check repo status before attempting fine-tuning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.gemma4.app" rel="noopener noreferrer"&gt;Gemma 4&lt;/a&gt;'s practical value proposition by use case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mobile / privacy-first apps&lt;/strong&gt; → E2B or E4B via LiteRT-LM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local assistant on laptop&lt;/strong&gt; → E4B via Ollama&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best open model on consumer GPU&lt;/strong&gt; → 26B A4B (MoE efficiency)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maximum quality, workstation&lt;/strong&gt; → 31B dense&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production cloud&lt;/strong&gt; → Vertex AI or GKE with vLLM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Apache 2.0 license removes the previous ambiguity for commercial &lt;br&gt;
use. For teams evaluating open models for production deployment, &lt;br&gt;
Gemma 4 is now a first-class option alongside Qwen 3.5 and Llama.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gemma</category>
      <category>opensource</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
