xTRam1/plan-and-act-data
Updated • 49 • 2
How to use xTRam1/plan-and-act-planner-70b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="xTRam1/plan-and-act-planner-70b")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("xTRam1/plan-and-act-planner-70b")
model = AutoModelForCausalLM.from_pretrained("xTRam1/plan-and-act-planner-70b")
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 xTRam1/plan-and-act-planner-70b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "xTRam1/plan-and-act-planner-70b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "xTRam1/plan-and-act-planner-70b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/xTRam1/plan-and-act-planner-70b
How to use xTRam1/plan-and-act-planner-70b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "xTRam1/plan-and-act-planner-70b" \
--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": "xTRam1/plan-and-act-planner-70b",
"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 "xTRam1/plan-and-act-planner-70b" \
--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": "xTRam1/plan-and-act-planner-70b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use xTRam1/plan-and-act-planner-70b with Docker Model Runner:
docker model run hf.co/xTRam1/plan-and-act-planner-70b
This is the Planner model used in the Plan-and-Act framework from the paper:
Plan-and-Act: Improving Planning of Agents for Long-Horizon Tasks
Code: https://github.com/SqueezeAILab/plan-and-act
The Planner generates structured, high-level plans for long-horizon tasks.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "xTRam1/plan-and-act-planner-70b"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
prompt = "Goal: Find the cheapest flight from SFO to JFK next Monday."
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512)
print(tok.decode(out[0], skip_special_tokens=True))
@inproceedings{
erdogan2025planandact,
title={Plan-and-Act: Improving Planning of Agents for Long-Horizon Tasks},
author={Lutfi Eren Erdogan and Hiroki Furuta and Sehoon Kim and Nicholas Lee and Suhong Moon and Gopala Anumanchipalli and Kurt Keutzer and Amir Gholami},
booktitle={Forty-second International Conference on Machine Learning},
year={2025},
url={https://openreview.net/forum?id=ybA4EcMmUZ}
}