Urgent.News

What's breaking now, across thousands of outlets.

Tech

Two Free Adapters, One Contract to Test

Two Free Adapters, One Contract to Test A free tier is a contract, not a promise. Write the contract down first. Then test it before you build on it. Most teams do this backwards. They wire the free endpoint into the app, ship, and learn the rules when something breaks. That is not architecture review. That is archaeology after the outage. This is an architecture review you can run this week. Two…

Two free adapters and a single contract are required to test the free model and server options. Before committing to any vendor, it is essential to establish constraints through a constraint interview. Every free dependency must be scrutinized in three ways: capacity, boundary behavior, and dependencies on system components.

MonkeyCode offers a free model and server option, with a starting budget of 10 million free tokens. Confirm the current number in your dashboard before planning anything, as numbers can change. Both latency and model identity are harder to verify upfront, so label them as unknown in your design. It is better to have an honest unknown than a false assumption that becomes a false assumption in testing.

Design the data flow with two separate lanes: one for token usage and another for compute usage. These lanes should fail for different reasons, so keep them apart. The API calls the model lane on request, while the worker calls the server lane on a schedule. Both lanes sit behind interfaces you own.

In your interface, export a usage object with inputTokens and outputTokens, an inferencePort function that handles completion requests, and a runtimePort function that runs jobs. There should be no throw for expected failures, as running out of tokens is normal on a free tier. Instead, return a value indicating the issue. Keep the shape of your adapter, swapping in the real endpoint and header names.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your Demo Server Should Never Hold the Model Key

A public demo needs a model, but it does not need the credential that pays for it. When free model access and a free server option push the cost of shipping a demo close to zero, the cheapest possible…

  • Demo server should not hold model key
  • Key should live in controlled process
  • Server holds token that expires

More from Friday 6 November →