How to Pass vLLM-Only Sampling Settings With extra_body
Send vLLM-only parameters such as top_k through the OpenAI client's extra_body field, since they are not part of the OpenAI API.
THE FIELD GUIDE
Understand model formats, context windows, quantization, embeddings, and sampling before choosing settings for a real task.
Send vLLM-only parameters such as top_k through the OpenAI client's extra_body field, since they are not part of the OpenAI API.
Pass a custom Jinja chat template file to vllm serve when a model ships without one or formats chats the wrong way.
Ask vLLM for a sentiment label from a fixed list by passing a structured_outputs choice through extra_body.
Ask LM Studio for JSON that matches a schema by sending response_format in the chat completion request.
Activate a LocalDocs collection from GPT4All's server chat window so your questions are answered from your own documents.
Convert a Hugging Face model to MLX format with mlx_lm.convert, optionally quantized to 4-bit, and upload it to the Hub.
Serve an embedding model with vLLM and call its /v1/embeddings endpoint to turn text into vectors for search.
Cache a long prompt once with mlx_lm.cache_prompt and reuse the cached prompt file across queries, so the model does not reprocess the…
Add MESSAGE lines to a Modelfile so the model sees example question-and-answer pairs before it ever answers you.
Set the seed for mlx_lm.generate or for a make_sampler sampler so the same prompt and settings give the same reply again.