For an enterprise, buying Llama looks like choosing a model but is really choosing a delivery path that can be contracted, audited, degraded, and costed. The key change in 2026 is that Meta's first-party Llama API public preview was retired on July 6, and the hosted route has shifted to cloud platforms and third-party inference providers. Enterprises that want data to stay in their own environment are returning to self-hosted open weights or private deployment.
Note: Llama and Meta Llama are trademarks of Meta Platforms, Inc. This article is a technical explanation and does not imply any affiliation, agency, sponsorship, or endorsement by Meta. Model licenses, available versions, and procurement terms may change; follow Meta and each provider's pages and the signed contract.
1. Define the procurement object first
The same phrase "buy Llama" can mean three different things:
- Open weights: download the weights and deploy them yourself; the license governs use and distribution.
- Hosted API: buy inference from a cloud platform or inference provider, billed by token or compute.
- Private deployment: a vendor delivers hardware, software, and operations, with a contract covering license, support, and SLA.
Procurement documents should state the model version, deployment location, data processing role, service scope, and acceptance metrics. Writing only "use the Llama model" is not enough and often leads to disputes over version, compliance, and fees.
2. Four access routes
| Route | Contract and billing | Data boundary | Operations burden | Suitable for |
|---|---|---|---|---|
| Cloud platform hosting | Contract with the cloud provider; settle on the cloud bill | Data enters the chosen cloud region and is subject to its DPA, regional, and sub-processor terms | Low | Organizations already on that cloud that need compliant procurement and region choice |
| Specialized inference provider API | Contract with each vendor; settlement varies | Data enters the vendor's service under the vendor's terms | Low | Fast launches, variable traffic, elastic pay-as-you-go |
| Self-hosted open weights | Hardware purchase or cloud GPU rental, plus a service contract | Can stay in your own environment; rented cloud GPUs are still third-party | High | Sensitive data, steady high volume, offline or edge |
| Domestic AI gateway | Domestic contract, RMB settlement, and invoices | Requests are forwarded through the gateway; review the gateway's data terms | Low | Domestic payment and invoices, one multi-model entry point |
Meta's own Llama API is no longer among the options. AWS Bedrock, Azure AI Foundry, and Google Vertex AI all offer some Llama models; available models, regions, and onboarding methods change quickly, so check the catalog before procurement.
No route is universally better; the decision turns on the data boundary and operations capability.
3. License review: open weights are not MIT
Llama uses a community license, not an OSI-approved open-source license. Taking Llama 4 and Llama 3.3 as examples, commercial use is permitted, but several hard constraints apply:
- A product or service with more than 700 million monthly active users needs a separate license from Meta, measured on the basis of the month before release; the rights may not be exercised without approval.
- When distributing the model, derivatives, or products containing the model, display "Built with Llama" prominently on the website, interface, or product documentation.
- When training or improving another model with Llama materials and distributing it, the model name must begin with "Llama."
- Distributed copies must include the license and Notice file and comply with the Acceptable Use Policy and trade compliance requirements.
- The license does not grant trademark rights; the Llama name may be used only to meet the attribution and naming requirements.
Legal should confirm each clause. Licenses may differ by version, and the LICENSE shipped with the model is the reference. The license provides no SLA, indemnity, or residency commitment.
4. Data residency and privacy
For hosted routes, confirm in writing: data region, whether data crosses borders, sub-processors, retention period, training use, deletion mechanism, security certifications, and audit reports. A marketing page saying "enterprise-grade security" is no substitute for a DPA and a contract.
Self-hosting is not automatically compliant either. Logs, monitoring, backups, remote operations, and account permissions can all become data egress paths. When renting cloud GPUs, the data still sits inside the cloud provider's infrastructure.
Teams in China also need to assess requirements such as the Personal Information Protection Law and the Data Security Law. Where personal information crosses the border, a security assessment or standard contract may be required, as determined by legal. Do not put real customer data into free tiers or trial environments.
5. Hardware, capacity, and cost
Self-hosted capacity planning cannot look at parameter count alone. GPU memory must hold weights, KV cache, framework overhead, and concurrency headroom at the same time; the longer the context and the higher the concurrency, the faster KV cache grows. Rough magnitudes:
- 8B class: 4-bit weights are about 4–6 GB; a single 16–24 GB card leaves headroom.
- 70B class: 4-bit weights are about 35–45 GB, usually requiring 48–80 GB of GPU memory or multiple cards.
- Llama 4 Scout: 109B total parameters and 17B active; 4-bit weights are about 55–60 GB, with additional KV cache reserved for long context.
- Llama 4 Maverick: 400B total parameters and 17B active; 4-bit weights are on the order of 200 GB, typically requiring a multi-GPU server.
MoE reduces compute pressure through fewer active parameters, not GPU memory footprint. Quantization saves memory, but verify quality on code, math, and multilingual tasks.
Total cost includes GPUs, electricity, cooling, racks, network, storage, redundancy, monitoring, and staff. Whether self-hosting pays off depends on utilization: long-running full load amortizes it, while low or spiky load is usually worse than a pay-as-you-go API. Prices follow vendor quotes and the model pricing page.
6. Accounts, permissions, and access control
- Register with a company domain and enable SSO/SAML and multi-factor authentication.
- Split accounts and keys by environment, project, and team, apply least privilege, and set expiry and rotation cycles. Store keys in a secrets manager, never in frontends, Git, or logs.
- Enable audit logs recording model calls, token consumption, and sensitive-data policy hits. Configure network egress allowlists, DLP, and retention policies.
When providing services externally, also confirm multi-tenant isolation and customer data boundaries; do not carry multiple customers on one key.
7. SLA, degradation, and exit
Ask during procurement: availability targets, p95 latency, support hours, incident response and recovery times, incident notification, compensation when targets are missed, maintenance windows, and model retirement notice, and write them into the contract.
Even a good SLA cannot replace a degradation design. Keep at least one backup channel: a second host, the same model on another cloud, or a small self-hosted model. Use an OpenAI-compatible interface as the abstraction layer, put model names, addresses, and keys into configuration, and add health checks, timeouts, retries, circuit breakers, and rate limits. Check credentials on 401, back off on 429, and switch on 5xx.
Degradation must consider data residency: a backup region across a border may violate the primary contract's residency commitment. Exit terms should also be explicit: how data is exported, how soon it is deleted, whether migration assistance is provided, and who owns model and prompt assets.
8. Pilot and launch acceptance
Run a reproducible two-to-four-week pilot:
- Define the scenario, success metrics, data classification, and data that must not enter third-party APIs.
- Have legal review the license, DPA, cross-border transfer, training use, and deletion terms, and record a conclusion.
- Open accounts, complete company verification, SSO, and key inventory; build primary and backup routes with a unified OpenAI-compatible abstraction layer.
- Run the pilot on real tasks and record success rate, p50/p95 latency, error rate, tokens per task, and rework rate.
- Stress-test long context, concurrency peaks, 429s, and model unavailability, and rehearse quota exhaustion, regional failure, and key leakage.
- Complete one real payment and invoice, and verify entity, currency, tax, and reimbursement flow.
Write acceptance criteria before the pilot. Enter production only when quality, cost, compliance, and operations all pass.
9. Cost monitoring and continuous optimization
After launch, do four things monthly: allocate tokens and cost by team and project; set budgets and alerts; check for abnormal calls and key leakage; review price changes.
The usual optimization order is: remove useless context and duplicate requests first, then route by task difficulty to models of different sizes, cache what can be cached, batch what can be batched, and only then consider self-hosting or long-term commitments. For self-hosting, also watch GPU utilization, queue time, and idle capacity.
The ZSQH AI Gateway provides an OpenAI-compatible interface and can serve as a unified entry point and backup channel, making bills, keys, and model-name mappings easier to manage centrally. Models and prices follow the model pricing page and may change; sign up if you need an account.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://ai.zhongshangqihang.com/v1",
api_key=os.environ["ZSQH_API_KEY"],
)
resp = client.chat.completions.create(
model="llama-3.3-70b-instruct", # follow the platform's model list
messages=[{"role": "user", "content": "Explain in three sentences what to confirm first when procuring Llama for an enterprise"}],
temperature=0.2,
max_tokens=256,
)
print(resp.choices[0].message.content)
10. Frequently asked questions
Does Meta still provide an official Llama API?
As of October 2026, Meta's Llama API public preview was retired on July 6, 2026, and the guidance was to migrate to third-party providers. Meta's developer platform currently emphasizes the Muse family, which is not the same family as Llama; whether there are new plans depends on Meta's pages.
Is Llama open source, and can it be used commercially?
Llama is an open-weight model, often called open source, but it uses a community license and is not an OSI-approved open-source license. Commercial use is generally permitted, subject to the monthly-active-user threshold, attribution, naming, Notice, AUP, and trade compliance conditions; the LICENSE for the specific version is the reference.
Is self-hosted Llama always cheaper than an API?
Not necessarily. Self-hosting removes per-token fees but adds GPUs, power, data center space, operations, and redundancy. It has the advantage at high utilization or when data cannot leave the country; pay-as-you-go APIs cost less at low or variable load.
Is data compliant just because it sits on your own server?
Not automatically. You also need to know who can access it, where logs and backups are stored, whether data crosses borders, and whether personal information is collected. Where personal information crosses the border, conduct a legal assessment under the applicable regulations.
How do you avoid single-vendor lock-in?
Use an OpenAI-compatible interface as the abstraction layer, put model names, addresses, and keys into configuration, keep a backup channel, write data export, deletion, migration assistance, and model retirement notice into the contract, and periodically retest substitute models on real tasks.
Related reading: OpenAI API Enterprise Procurement Checklist, DeepSeek API Enterprise Checklist, How to Choose a Multi-Model API Platform.
