Case Studies

Encrypted Llama 3.1 Inference: Is 1.7 Tokens/s Enough?

Belfort Labs reports homomorphic-encrypted inference for Llama 3.1 8B at 1.7 tokens per second. This analysis examines the practical impact on chat, RAG, and AI Agent architectures, and identifies the metrics that should be verified before deployment.

Font size

Belfort Labs ran Llama 3.1 8B in a homomorphic encryption environment and reported a generation speed of 1.7 tokens per second.

Encrypted Llama 3.1 Inference: Is 1.7 Tokens/s Enough?Encrypted Llama 3.1 …What the 1.7 token/s result showsWhy encrypted inference is so slowAgents fear latency more than chat doesThe real deployment boundariesLook beyond token speedEditorial perspectiveSource
Article structure

The key question is not whether the model can run, but whether an AI Agent can tolerate the latency.

Project page: bel.belfortlabs.com

What the 1.7 token/s result shows

bel.belfortlabs.com demonstrates inference with Llama 3.1 8B in a homomorphic encryption environment.

Two qualifications matter.

First, this is an 8B model, not an extra-large one. Its size leaves room for local deployment, but it does not eliminate the additional computation required by homomorphic encryption.

Second, the result comes from a public project page whose headline generation speed is 1.7 tokens per second.

In other words, the model generates fewer than two tokens per second. Generating a 20-token response would theoretically take nearly 12 seconds.

That estimate does not include time to the first token, context preprocessing, or system overhead.

Demos of this kind often share the same problem: proving that something can run is very different from proving that it can run reliably enough to deploy.

Homomorphic-encrypted inference needs to answer at least four questions:

  • What hardware is used?
  • How much memory does each request consume?
  • How are concurrent requests scheduled?
  • Does end-to-end latency consist of anything beyond generation speed?

The clearest public metric on the project page is currently 1.7 tokens/s. The hardware configuration, concurrency behavior, and full cost still need to be verified.

Why encrypted inference is so slow

Conventional local inference follows a standard computation path.

The input is converted into tokens, the model performs matrix operations, and output tokens are generated one at a time.

Homomorphic encryption adds a complication: ciphertext cannot be computed on as if it were an ordinary integer.

To support addition and multiplication on encrypted data, the underlying system must use the arithmetic structures required by the chosen homomorphic encryption scheme. After computation, the result must also be re-encoded and decrypted.

The overhead includes ciphertext expansion, parameter conversion, computation, and communication.

A single inference operation can be divided into three stages:

  1. Input processing: encoding the prompt into a form suitable for encrypted computation;
  2. Model computation: running Llama 3.1 8B inference in the ciphertext domain;
  3. Output processing: decoding the generated result and handling conversions between ciphertext representations.

Each stage incurs additional cost.

One point is easy to misunderstand: homomorphic encryption does not wrap each token in a separate layer of TLS, nor does it merely encrypt model files on disk.

It protects the computation process. The computing party receives ciphertext but must still execute the model.

Performance in conventional local inference is primarily determined by GPU compute, memory bandwidth, and model size.

Homomorphic-encrypted inference is also affected by ciphertext size, the arithmetic scheme, parameter conversions, and implementation efficiency.

For that reason, 1.7 tokens/s does not simply reveal how slow Llama 3.1 8B is. It reflects the combined effect of homomorphic encryption, the specific implementation, and the target hardware.

Without complete environment details, it cannot be compared fairly with local performance on a consumer GPU.

Agents fear latency more than chat does

A single-turn question-and-answer interaction that takes tens of seconds may still be acceptable to many users.

AI Agents face a more difficult problem. They often follow a sequence like this:

understand goal → call tool → read result → decide next step → call tool again → summarize answer

Each step may generate model output.

If one call produces 100 tokens, generation alone would take about 59 seconds at 1.7 tokens/s. Even an instant tool cannot compensate for that delay.

Latency also accumulates along the chain.

If an Agent calls the model five times consecutively, the generation phase alone takes close to five minutes. That excludes tool response time, context reconstruction, and repeated calls caused by Agent retries.

Cloud-based Agents can usually run independent tasks in parallel. For example, they can query three knowledge bases simultaneously, inspect five documents separately, and then use one model to summarize the results.

Private homomorphic inference has a different cost structure. It typically relies on limited encrypted computing resources. If multiple requests cannot be parallelized effectively, wait times continue to grow.

This produces a counterintuitive result:

  • A chat scenario requires only one response path;
  • An Agent scenario requires multiple paths of model calls;
  • The same token speed is amplified in an Agent.

The relevant question is therefore not only whether users can tolerate waiting for one answer. It is also:

How many model calls are on the Agent’s critical path? Can those calls run in parallel? If one fails, how many steps must be repeated?

For coding Agents, browser Agents, and long-running automation workflows, these numbers are often substantial.

The real deployment boundaries

Homomorphic-encrypted inference still has valid use cases.

It is better suited to tasks such as:

  • Data cannot leave its trust boundary: for example, internal hospital documents, legal materials, or unpublished research data;
  • Low request volume: a small number of requests per day rather than a continuously available service;
  • Responses can queue: users are willing to wait, or the work already belongs in an offline batch window;
  • Isolation requirements are auditable: the security team can explain key management, compute boundaries, and ciphertext movement;
  • Models are relatively small: 8B-class models can handle narrow tasks such as summarization, classification, and information extraction.

It is clearly less suitable for:

  • High-frequency chat;
  • Low-latency code completion;
  • Multi-Agent parallel orchestration;
  • Complex RAG;
  • Long-chain automation that requires continuous feedback.

RAG is a particularly difficult case. Agents often need to retrieve a large number of documents before the model can generate an answer.

Even if retrieval takes only a few hundred milliseconds, encrypted inference may still dominate total response time.

If one task processes 50 documents, the wait shifts from an individual user waiting for one answer to a system waiting for a batch. The longer the queue, the more important throughput and scheduling become.

Deployment planning must also account for the following relationship:

total wait time ≈ number of requests ÷ effective concurrency × per-request latency

The 1.7 tokens/s figure is a generation metric, not a complete request-time measurement. Using it directly to calculate QPS would therefore be inaccurate.

Look beyond token speed

Encrypted inference should be evaluated on at least five dimensions:

MetricWhy it matters
Security boundaryWhere keys are stored, who can see plaintext, and whether the computing party can access inputs and outputs
End-to-end latencyIncludes input conversion, model computation, output processing, and time to the first token
Hardware costCPU, GPU, and memory usage, plus the marginal cost of each request
Context lengthCiphertext expansion and processing time from long prompts may grow nonlinearly
ConcurrencyThe ability to handle one request does not imply the ability to support multiple users or batch workloads

Security is not a binary label.

Computing on encrypted data can reduce plaintext exposure, but the system still needs a key hierarchy, trusted execution boundaries, and logging policies. A deployment error can leak data just as easily.

Hardware cost cannot be ignored either.

If an encrypted GPU instance costs several times as much as a standard instance but handles only a fraction of the traffic of a conventional cloud API, total cost may still be competitive. If additional throughput must be purchased through scaling, however, the economics deteriorate quickly.

Context length is another limitation. An 8B model does not mean the encrypted path can comfortably process 128K tokens.

A model supporting a given context limit and a homomorphic-encryption implementation capable of handling the same length at reasonable cost are separate claims.

At this stage, 1.7 tokens/s should be treated as directional validation rather than a product performance conclusion.

It demonstrates that Llama 3.1 8B can perform inference in a homomorphic encryption environment. It does not automatically show that the approach is suitable for high-concurrency production deployment.

Editorial perspective

The near-term value of a homomorphic-encrypted LLM may not lie in replacing cloud APIs such as Claude or GPT. Its value may instead be offering an auditable isolation model for a small number of highly sensitive workloads: data does not need to be handed to a cloud service, and the model does not need to be exposed to external tenants.

This demonstration differs from earlier rounds of “running a large model locally” because it exposes the cost of computation directly through the user experience. At 1.7 tokens/s, the metric is not an inconsequential laboratory number; it can change Agent architecture.

The first near-term deployments are more likely to be low-frequency, queueable summarization, classification, and internal document-processing workloads than continuous conversational Agents. For multi-tool workflows, the bottleneck may shift from model capability to task orchestration and concurrent scheduling.

Public information remains insufficient to confirm the specific hardware, real end-to-end latency, and deployment cost. There is not yet enough evidence to support a production-readiness conclusion.

Source

https://bel.belfortlabs.com/

Source: https://bel.belfortlabs.com/
Comments · 0

No comments yet — start the discussion

Leave a comment