endishai/lexenvs-tasks
Updated • 191
How to use endishai/qwen2.5-32b-lexenvs-grpo with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="endishai/qwen2.5-32b-lexenvs-grpo")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("endishai/qwen2.5-32b-lexenvs-grpo")
model = AutoModelForCausalLM.from_pretrained("endishai/qwen2.5-32b-lexenvs-grpo")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use endishai/qwen2.5-32b-lexenvs-grpo with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "endishai/qwen2.5-32b-lexenvs-grpo"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "endishai/qwen2.5-32b-lexenvs-grpo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/endishai/qwen2.5-32b-lexenvs-grpo
How to use endishai/qwen2.5-32b-lexenvs-grpo with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "endishai/qwen2.5-32b-lexenvs-grpo" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "endishai/qwen2.5-32b-lexenvs-grpo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "endishai/qwen2.5-32b-lexenvs-grpo" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "endishai/qwen2.5-32b-lexenvs-grpo",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use endishai/qwen2.5-32b-lexenvs-grpo with Docker Model Runner:
docker model run hf.co/endishai/qwen2.5-32b-lexenvs-grpo
A GRPO-trained variant of Qwen/Qwen2.5-32B-Instruct specialized for credit card optimization reasoning.
On a held-out test set of 30 tasks, this model scores ~0.51 average reward, outperforming Claude Opus 4.6 (~0.41), Claude Sonnet 4.6 (0.396), and GPT-4o (0.363).
| Model | Test Avg Reward |
|---|---|
| Qwen 32B (base) | ~0.24 |
| GPT-4o | 0.363 |
| Claude Sonnet 4.6 | 0.396 |
| Claude Opus 4.6 | ~0.41 |
| This model (Qwen 32B + GRPO) | ~0.51 |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"endishai/qwen2.5-32b-lexenvs-grpo", torch_dtype="auto", device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("endishai/qwen2.5-32b-lexenvs-grpo")
messages = [
{"role": "system", "content": "You are a financial advisor..."},
{"role": "user", "content": "I spend $600/mo on dining..."},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
outputs = model.generate(inputs, max_new_tokens=4096, temperature=0.4)
print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
Credit card optimization reasoning and portfolio selection. Not for live consumer financial advice.
@misc{lexenvs2026,
title={LexEnvs: A Harbor RL Environment for Credit Card Optimization},
author={Imberman, Daniel and Book, Kenny},
year={2026},
url={https://huggingface.co/endishai/qwen2.5-32b-lexenvs-grpo}
}