Inference for PROs
Hugging Face PRO subscribers get curated, rate-limit-boosted HTTP inference endpoints served by text-generation-inference for models such as Llama 3, Mixtral 8x7B, Zephyr, Code Llama, Stable Diffusion XL and Bark, intended for prototyping rather than heavy production (Inference Endpoints is recommended for that). Usage is shown via curl, the huggingface_hub InferenceClient and the OpenAI-compatible Messages API, including Llama 2 chat templates and Code Llama's <PRE>/<SUF>/<MID> infilling format. Generation parameters (do_sample, temperature, top_k, top_p, repetition_penalty, max_new_tokens, stop_sequences, SDXL guidance and steps) are explained, along with disabling response caching via the x-use-cache: 0 header and token streaming.
Related posts
- From OpenAI to Open LLMs with Messages API on Hugging Face
Hugging Face mediumAdeptText Generation Inference 1.4.0 adds a Messages API compatible with OpenAI's Chat Completion API, so open LLMs on Inference Endpoints can be called from existing OpenAI client code by changing the base URL and token. The guide deploys Nous-Hermes-2-Mixtral-8x7B-DPO via huggingface_hub with TGI token-limit settings and then calls it from the OpenAI Python and JavaScript clients. It also plugs the endpoint into LangChain (ChatOpenAI) and LlamaIndex (OpenAILike) RAG pipelines. Limitations: no function calling, only models with a chat_template, and a subset of parameters (stream, max_tokens, temperature, top_p, seed, logprobs, frequency_penalty).
- Deploy LLMs with Hugging Face Inference Endpoints
Hugging Face mediumAdeptFalcon 40B Instruct can be deployed to Hugging Face Inference Endpoints through the web UI by choosing a repository, cloud, region and instance. For best performance the suggested 4x T4 instance should be switched to a single A100. Once the endpoint is live it can be called with cURL, and generation is controlled through parameters such as temperature, max_new_tokens (max 512), top_k/top_p, repetition_penalty and stop sequences. Tokens can be streamed to clients using huggingface_hub's InferenceClient in Python or HfInferenceEndpoint from @huggingface/inference in JavaScript, with code that skips special tokens and stops on stop sequences.
- Hugging Face Text Generation Inference available for AWS Inferentia2
Hugging Face mediumAdeptText Generation Inference (TGI) is now generally available on AWS Inferentia2 through Amazon SageMaker, offering an alternative to GPUs for serving open LLMs such as Llama and Mistral. A walkthrough deploys Zephyr 7B on an ml.inf2.8xlarge using the TGI Neuronx container. Because Inferentia2 lacks dynamic shapes, batch size, sequence length, core count and cast type must be fixed at compile time. A neuron model cache provides pre-compiled configurations; compiling an uncached one with optimum-cli can take up to 45 minutes. The deployment environment variables (HF_NUM_CORES, HF_BATCH_SIZE, HF_SEQUENCE_LENGTH, MAX_TOTAL_TOKENS) must match those compile-time settings.
- Make your llama generation time fly with AWS Inferentia2
Hugging Face mediumAdeptoptimum-neuron can now compile and export Llama 2 models for text generation on AWS Inferentia2, using static input shapes (batch size, 2048 sequence length that also bounds the KV cache) and a configurable core count and fp16 precision. Compiled models can be saved or pushed to the Hub and used via transformers-style generate() or optimum-neuron pipelines, supporting greedy search and top-k/top-p sampling. Benchmarks on inf2.48xlarge show Llama 2 7B encoding 256 tokens in about 0.5s, with throughput up to 750 tokens/s at batch size 4, while a 2-core 'budget' config on inf2.xlarge manages about 22–32 tokens/s. Latency is fairly insensitive to batch size, but throughput is capped by device memory and the static sequence length limits long contexts.
- Run a vLLM Server on HF Jobs in One Command
Hugging Face mediumAdeptA single `hf jobs run` command using the official vllm/vllm-openai image, a GPU `--flavor` and `--expose 8000` launches a private, OpenAI-compatible LLM endpoint on Hugging Face infrastructure, billed per second and gated by HF token auth through the jobs proxy. The guide covers querying via curl and the OpenAI Python client, and scaling to Qwen3.5-122B on 2×H200 with `--tensor-parallel-size`, using capped `--max-model-len` and `--max-num-seqs` to avoid out-of-memory errors. It also shows a Gradio chat UI, SSH debugging, and enabling tool-call parsing to back the Pi coding agent. HF Jobs suits experiments, evals and batch generation, while Inference Endpoints fit production workloads that need scale-to-zero and finer access control.