Summary
GEPA already supports local/custom model workflows through LiteLLM model strings and callable reflection_lm functions, and some examples use Ollama. However, the vLLM + Hugging Face workflow is not first-class or clearly documented.
We should add first-class support, examples, and documentation for running GEPA with a Hugging Face model served through vLLM, so users can evaluate and optimize prompts without relying only on paid API keys.
Current State
Local models are not impossible today:
gepa.lm.LM forwards extra LiteLLM parameters such as api_base and api_key.
reflection_lm can be a model string or any callable.
- Existing docs/examples mention local Ollama usage.
- The AnyMaths adapter README says LiteLLM-supported providers include HuggingFace, Groq, vLLM, Ollama, etc.
The gap is that there is no dedicated, tested, end-to-end vLLM + Hugging Face guide/example showing how to start a vLLM OpenAI-compatible server and use it from GEPA.
Motivation
Many users want to test GEPA with open models such as Qwen, Llama, Mistral, Gemma, or other Hugging Face models. The current central docs mainly point users toward provider model strings and API-key based examples, while local model guidance is spread across adapter-specific examples. This creates friction for:
- local experimentation with open-weight models
- reproducible benchmarking on self-hosted models
- GPU-backed evaluation using vLLM
- avoiding paid API usage during development
Because GEPA already routes LMs through gepa.lm.LM and LiteLLM, this feature should make the vLLM path explicit, tested, and documented.
Proposed Scope
Add a supported workflow for using vLLM as the base model and/or reflection model by loading a Hugging Face model and exposing it to GEPA through an OpenAI-compatible endpoint.
The expected user flow should look roughly like:
uv sync --extra dev
uv run python -m vllm.entrypoints.openai.api_server \
--model Qwen/Qwen2.5-7B-Instruct \
--served-model-name qwen2.5-7b-instruct \
--host 0.0.0.0 \
--port 8000
Then GEPA should be usable with that local endpoint:
from gepa.lm import LM
lm = LM(
model="openai/qwen2.5-7b-instruct",
api_base="http://localhost:8000/v1",
api_key="EMPTY",
)
If LiteLLM's native vLLM provider is preferred, document and test that supported model string instead.
Tasks
Acceptance Criteria
Out of Scope
- Managing GPU provisioning automatically.
- Downloading large Hugging Face models during unit tests.
- Making vLLM a required GEPA dependency.
- Guaranteeing all Hugging Face models work without chat-template/model-specific configuration.
Notes
The main implementation may be mostly documentation and examples because GEPA already has a LiteLLM-backed LM abstraction and accepts custom callables. The important part is making the local vLLM/Hugging Face path explicit, tested, and easy to follow.
Summary
GEPA already supports local/custom model workflows through LiteLLM model strings and callable
reflection_lmfunctions, and some examples use Ollama. However, the vLLM + Hugging Face workflow is not first-class or clearly documented.We should add first-class support, examples, and documentation for running GEPA with a Hugging Face model served through vLLM, so users can evaluate and optimize prompts without relying only on paid API keys.
Current State
Local models are not impossible today:
gepa.lm.LMforwards extra LiteLLM parameters such asapi_baseandapi_key.reflection_lmcan be a model string or any callable.The gap is that there is no dedicated, tested, end-to-end vLLM + Hugging Face guide/example showing how to start a vLLM OpenAI-compatible server and use it from GEPA.
Motivation
Many users want to test GEPA with open models such as Qwen, Llama, Mistral, Gemma, or other Hugging Face models. The current central docs mainly point users toward provider model strings and API-key based examples, while local model guidance is spread across adapter-specific examples. This creates friction for:
Because GEPA already routes LMs through
gepa.lm.LMand LiteLLM, this feature should make the vLLM path explicit, tested, and documented.Proposed Scope
Add a supported workflow for using vLLM as the base model and/or reflection model by loading a Hugging Face model and exposing it to GEPA through an OpenAI-compatible endpoint.
The expected user flow should look roughly like:
Then GEPA should be usable with that local endpoint:
If LiteLLM's native vLLM provider is preferred, document and test that supported model string instead.
Tasks
Decide the public API for vLLM usage.
LM("openai/<served-model-name>", api_base="http://localhost:8000/v1", api_key="EMPTY")?make_vllm_lm(...)?make_litellm_lmandLMdesign.Add an optional dependency group for vLLM usage.
vllm = ["vllm", "transformers", "huggingface-hub"]if we want GEPA to help users run the server locally.Add documentation for running a Hugging Face model with vLLM.
api_base,api_key="EMPTY", served model names, and common port defaults.Add at least one runnable example.
examples/vllm_huggingface/README.mdexamples/vllm_huggingface/main.pyuv run.Ensure both GEPA model roles can use vLLM.
Add unit tests around LM argument forwarding.
api_baseis forwarded to LiteLLM.api_keyis forwarded to LiteLLM.Add an optional integration test or manual verification section.
LM.__call__andLM.batch_completeboth work.Update docs/API references.
docs/docs/guides/quickstart.mdor add a dedicated local models guide.docs/docs/guides/cost-tracking.mdif local vLLM calls report zero or unavailable cost.Add troubleshooting notes.
--served-model-nameandLM(model=...)./v1suffix inapi_base.max_workersis too high.Acceptance Criteria
gepa.lm.LM.reflection_lminGEPAConfig.Out of Scope
Notes
The main implementation may be mostly documentation and examples because GEPA already has a LiteLLM-backed
LMabstraction and accepts custom callables. The important part is making the local vLLM/Hugging Face path explicit, tested, and easy to follow.