# Hf-inference reports an error for my model after Inference was enabled

> Source: <https://discuss.huggingface.co/t/hf-inference-reports-an-error-for-my-model-after-inference-was-enabled/193219#post_2>
> Published: 2026-12-06 16:13:56+00:00

**Recommendation:** Tag decoder-only Llama models as `text-generation` in README.md frontmatter instead of `translation`, which expects Seq2Seq architectures and fails the Inference API health check.
More in the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

The `hf-inference` error occurs because the `LlamaForCausalLM` architecture is incompatible with the `translation` pipeline tag.

In the `transformers` library, the `translation` pipeline is designed for encoder-decoder (Seq2Seq) architectures. Since Llama is a decoder-only causal language model, the serverless Inference API fails when it attempts to initialize the weights inside a translation pipeline during the health check.

To fix this, update the YAML frontmatter in your repository’s `README.md` to use the `text-generation` pipeline tag. The Inference API will then correctly load the model using `AutoModelForCausalLM`. You can still perform translation by passing your custom instruction prompts and special tokens directly to the text generation endpoint.
