Clavem

Licensing AI and local LLM apps: what to protect, how to tier, how to stay offline

License the app, not the model. A local LLM app can verify a signed token offline, which suits users who chose it to avoid the cloud. Hosted AI features that cost you money per request need metering, which a license key alone does not give you.

Two kinds of AI app, two licensing problems

“AI app” covers two different businesses.

A local app runs a model on the customer’s machine. Your marginal cost per use is nothing, and the customer often chose it because nothing leaves their computer. The licensing problem is the same as for any desktop software, with extra weight on offline use and on privacy.

A hosted app calls a model API or runs inference on your servers. Every request costs you money. Here the license is only one input. You also need to meter usage and put limits on it, which is a different system.

Most of this article is about the first kind, because the license-key approach fits it directly. The last section covers the second.

License the app, not the model

Your app is one thing, the model it runs is another, and they may have different owners and different terms. If you bundle or download a model for the customer, its license applies to how you distribute it. For example, the Llama 3.1 Community License, as of November 2026, grants a royalty-free license to use, copy, modify and distribute the materials, and attaches conditions to redistribution: you must provide a copy of the agreement and display “Built with Llama” on a related website, interface, blog post, about page or product documentation. It also requires a separate license from Meta if the licensee’s products reach more than 700 million monthly active users. Other models use other terms, such as permissive licenses with no such conditions.

Three rules follow.

  1. Read the license of each model before you bundle it, and keep a copy in your repository.
  2. Do not describe your license key as licensing the model. It licenses your app. Say so in your terms.
  3. Let customers bring their own model if you can. Then the model’s license is between them and its publisher.

This is general information, not legal advice. If you sell commercial software built on someone else’s weights, a lawyer should read the terms.

What the license check should send

Privacy-minded customers read network traffic. Make the license call easy to audit and keep prompts, documents and model output out of it.

The Clavem License API call takes only a few fields: license_key and instance_name at activation, an optional fingerprint, and license_key plus instance_id at validation. Document exactly this in your privacy page. Tell customers the fingerprint is a hash and show what you hash. A one-sentence promise that “the license check never includes prompts or files” is worth more than a long policy, and it is true by construction when the call has only those fields.

Then give offline users a route that needs no call at all: verify the signed token locally. The token lasts 14 days before the app should check online again, and your app can decide how long to trust an old token. For an app whose users go offline by design, let a perpetual license keep working indefinitely on a validly signed token and refresh when a connection happens to exist. See offline-first apps and licensing.

Tiering without a server round trip

AI apps often sell tiers: a basic plan with small models, a pro plan with larger models or extra features. There are two ways to model that in Clavem, and they differ offline.

Approach How it works Offline?
One product, a variant per tier Map each Stripe price to the same Clavem product with a label such as Pro. The label becomes meta.variant_name in License API responses Online only. The signed token does not carry the variant
One product per tier Map each Stripe price to a separate Clavem product. A price mapping wins over a mapping for the whole Stripe product Yes. The token’s pid claim names the product, so the tier is signed

If your Pro features must work offline, use one product per tier. The app decodes the token’s payload, reads pid, selects the matching public key from the keys compiled into the app, and then verifies the signature. Compile in one public key per tier. The cost is that each tier is a separate product in the dashboard, with its own device limit and releases. Upgrading a customer between tiers means issuing a license in the other product, which you handle through Stripe checkout or by hand with the management API.

If Pro only needs to work online, or you accept that the tier is read at the last online check and stored, the variant approach is simpler. Keep the stored value next to the token and refresh it on every successful validation.

One-time, subscription or both

A local model costs you nothing per use, so the usual argument for a subscription, covering ongoing cost, is weak. Reasons that remain are continuing development, regular model updates and any hosted extras. A common split is a perpetual license for the app, with a subscription for hosted features or for access to new model packs. Clavem expires a subscription license three days after the paid period ends, and a perpetual license has no expiry. The one-time purchase versus subscription article works through the trade-off.

Delivering models

Model files are large, often several gigabytes each. Clavem allows files up to 5 GiB each, and downloads are not metered, but storage is: 10 GB on Indie, 50 GB on Studio and 250 GB on Scale. If the weights are public, point the app at their original source and gate only your own code and fine-tunes. If the weights are yours, serve them through the signed download links, which expire after one hour. Neither stops a customer from sharing a file they downloaded. See delivering downloads after payment.

Hosted AI: the part a key does not solve

If requests hit your servers and cost you money, you need to answer three questions on each request: who is this, are they entitled, and how much have they used? A license key helps with the first two. Your backend can call the License API with the customer’s key and cache the answer. It does not answer the third. Clavem does not meter usage or sell credits. You keep the counters in your own database and compare them with the limits for the tier. If usage-based pricing is central to your product, plan to build or buy that part separately, or look at a billing product that meters usage.

Doing this with Clavem

Clavem fits the local-app case directly: a key per purchase, a device limit, a signed token for offline checks, release files and an update endpoint. It covers entitlement for a hosted app but not metering. Start with the offline verification page and decide early whether your tiers need to work without a network, because that decides whether they are variants or separate products.

Questions

Can I sell an app that bundles an open-weight model?

Only if the model's own license allows it, and each model differs. Some licenses allow commercial use with conditions such as showing an attribution or including a copy of the agreement. Read the license of every model you bundle, and get legal advice if the terms are unclear.

Does a license key protect model weights from copying?

No. A key tells your app whether a customer paid. Weights stored on the customer's disk can be copied regardless. If the weights are your product, serve them through expiring download links and accept that a determined person can still share them.

How do I enforce a Pro tier offline?

Put each tier in its own product, because the signed token names the product with its pid claim. The variant name is returned only in online responses and is not part of the token.

Sources

  1. Llama 3.1 Community License Agreement (as of November 2026)