Instructions to use bbkdevops/Qwen-AgentWorld-ULTRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use bbkdevops/Qwen-AgentWorld-ULTRA with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL # Run inference directly in the terminal: llama cli -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL # Run inference directly in the terminal: llama cli -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL # Run inference directly in the terminal: ./llama-cli -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL # Run inference directly in the terminal: ./build/bin/llama-cli -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Use Docker
docker model run hf.co/bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
- LM Studio
- Jan
- Ollama
How to use bbkdevops/Qwen-AgentWorld-ULTRA with Ollama:
ollama run hf.co/bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
- Unsloth Desktop
- Pi
How to use bbkdevops/Qwen-AgentWorld-ULTRA with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bbkdevops/Qwen-AgentWorld-ULTRA with Docker Model Runner:
docker model run hf.co/bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
- Lemonade
How to use bbkdevops/Qwen-AgentWorld-ULTRA with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Run and chat with the model
lemonade run user.Qwen-AgentWorld-ULTRA-IQ4_NL
List all available models
lemonade list
- Hermes Agent
How to use bbkdevops/Qwen-AgentWorld-ULTRA with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bbkdevops/Qwen-AgentWorld-ULTRA with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "bbkdevops/Qwen-AgentWorld-ULTRA:IQ4_NL" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Qwen-AgentWorld — Native Language World Model for Agentic Environment Simulation
"ภาษาคือโลก" / Language is the World — โมเดลโลกที่สื่อสารเป็นภาษาธรรมชาติ จำลองการเปลี่ยนแปลงของสภาพแวดล้อม เอเจนต์ การใช้เครื่องมือ และผลลัพธ์แบบ end-to-end
สารบัญ / TOC
- ภาพรวม
- สถาปัตยกรรม
- โครงสร้างโฟลเดอร์
- ติดตั้ง
- Quickstart
- World Model API
- Simulation / Dream
- Training
- Ollama / llama.cpp
- Evaluation
ภาพรวม / Overview
Qwen-AgentWorld คือ native language world model ที่เทรนจากฐาน Qwen3.8-27B-TurboFCFusion (GGUF IQ4_NL, 16.5 GB, 65 blocks, 262K context) เพื่อทำหน้าที่จำลองโลกสำหรับเอเจนต์:
[Observation_t + Action_t + History] --Qwen-AgentWorld--> [Observation_{t+1}, Reward, Done, Info]
ทุกอย่างเป็น ภาษา — observation, action, tool call, tool result, reward explanation — โมเดลทำนาย ภาษาที่สภาพแวดล้อมจะตอบกลับ ไม่ใช่เวกเตอร์ซ่อน
Use cases
- Agentic simulation — ฝึกหรือประเมินเอเจนต์โดยไม่ต้องเรียก environment จริง (WebShop, ALFWorld, OSWorld, CodeEnv, ToolEnv)
- Dream training (Dreamer-style) — ให้เอเจนต์ rollout ในความฝันของ world model แล้วค่อย deploy จริง
- Planning / Search — MCTS / Best-of-N โดยใช้ world model เป็น simulator
- Data synthesis — สร้าง trajectory สังเคราะห์สำหรับ SFT/RL
Base model file:
D:\AGI\Qwen3.8-27B-TurboFCFusion-735-882-Here-Uncen-NEO-CODER-MAX-MTP-IQ4_NL.gguf(17,753,101,856 bytes, GGUFv3, qwen35 arch)
สถาปัตยกรรม / Architecture
┌─────────────────────────────────────────────────────────────┐
│ Qwen-AgentWorld (27B) │
│ Qwen3.5 hybrid: Attention (full-interval=4) + Mamba2 SSM │
│ 65 blocks | d=5120 | FFN 17408 | 24H / 4KV | 65 layers │
│ RoPE 10M freq | MTP next-n=1 | 262K context │
├─────────────────────────────────────────────────────────────┤
│ World Model Interface (language-native) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Obs→Text │→ │ Act→Text │→ │ Qwen │→ │Text→ Env │ │
│ │ Encoder │ │ Encoder │ │ 27B │ │ Decoder │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ Output JSON: {next_obs, reward, done, info, thought} │
├─────────────────────────────────────────────────────────────┤
│ Environments (text-serialized) │
│ ALFWorld | WebShop | CodeEnv | ToolEnv | OSWorld | TextGame│
├─────────────────────────────────────────────────────────────┤
│ Dream Engine | Trajectory Buffer | Reward Model │
└─────────────────────────────────────────────────────────────┘
World Model Prompt Contract (qwen_agent_world/world_model.py:42):
- Input:
system= World Simulator instructions (THAI/EN) + environment spec + history + current obs + action - Output: strict JSON:
{"next_observation": str, "reward": float, "done": bool, "info": str, "thought": str}
Hybrid SSM+Attention (qwen35.* kv): ทุก 4th block ใช้ full attention, ที่เหลือเป็น Mamba2 SSM — เหมาะกับ trajectory ยาว 262K
โครงสร้างโฟลเดอร์
D:\AGI\Qwen-AgentWorld\
├── Qwen3.8-27B-TurboFCFusion-...gguf (symlink → D:\AGI\*.gguf)
├── qwen_agent_world/
│ ├── config.py # WorldModelConfig, EnvConfig
│ ├── world_model.py # QwenAgentWorld core (GGUF+HF dual backend)
│ ├── environments/ # BaseEnv + 6 envs + Registry
│ ├── simulation/ # DreamEngine, Trajectory, Dreamer
│ ├── training/ # Dataset, Trainer, LoRA, RewardModel
│ ├── inference/ # OpenAI-compatible server + client
│ └── utils/ # metrics, logging
├── configs/ # world_model.yaml, training.yaml, environments.yaml
├── scripts/ # train.py, inference.py, evaluate.py, benchmark.py
├── examples/ # quickstart.py, agent_in_dream.py, tool_use_simulation.py
└── Modelfile # Ollama
ติดตั้ง / Installation
# 1. สร้าง venv (Python 3.10+ แนะนำ 3.11/3.12)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# 2. ติดตั้ง dependencies
pip install -r requirements.txt
# 3. ติดตั้ง llama-cpp-python แบบ GPU (RTX 3090 = cuBLAS)
# เลือก 1 วิธี:
pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu126
# หรือ build จาก source (ต้องมี CUDA 12.6 + VS2022)
CMAKE_ARGS="-DGGML_CUDA=1" pip install llama-cpp-python --no-cache-dir --force-reinstall
# 4. (ทางเลือก) Ollama
ollama create qwen-agentworld -f Modelfile
ollama run qwen-agentworld
requirements.txt รวม: transformers, torch, accelerate, peft, datasets, llama-cpp-python, fastapi, uvicorn, pydantic, pyyaml, rich, numpy
Quickstart
1. Python — World Model โดยตรง
from qwen_agent_world import QwenAgentWorld, WorldModelConfig
wm = QwenAgentWorld(
WorldModelConfig(
gguf_path=r"D:\AGI\Qwen3.8-27B-TurboFCFusion-735-882-Here-Uncen-NEO-CODER-MAX-MTP-IQ4_NL.gguf",
n_ctx=32768, # ใส่ 262144 ถ้า VRAM พอ (ต้อง offload)
n_gpu_layers=-1, # -1 = offload ทั้งหมดเท่าที่ VRAM พอ
temperature=0.7,
use_mtp=True, # เปิด MTP speculative (ถ้า backend รองรับ)
)
)
# Step เดียว
result = wm.step(
observation="คุณอยู่ในห้องครัว มีแอปเปิ้ลบนโต๊ะ",
action="หยิบแอปเปิ้ล",
history=[],
env_spec="ALFWorld: ห้องครัว, เป้าหมาย=นำแอปเปิ้ลไปตู้เย็น"
)
print(result.next_observation) # "คุณหยิบแอปเปิ้ลสำเร็จ ..."
print(result.reward, result.done)
# Rollout หลายก้าว (dream)
trajectory = wm.rollout(
initial_observation="หน้า WebShop: ค้นหา 'หูฟังไร้สาย'",
actions=["ค้นหา 'Sony WH-1000XM5'", "คลิกผลลัพธ์แรก", "เพิ่มลงตะกร้า"],
env_spec="WebShop"
)
ดู examples/quickstart.py สำหรับตัวอย่างเต็ม
2. Dream Engine — ฝึกเอเจนต์ในความฝัน
from qwen_agent_world.simulation import DreamEngine
from qwen_agent_world.environments import get_env
engine = DreamEngine(world_model=wm, env_name="alfworld")
# เก็บ trajectory จริงเล็กน้อยเพื่อ seed
engine.seed_from_real_env(get_env("alfworld"), episodes=5)
# ฝันต่อ 100 episodes โดยไม่แตะ env จริง
dreams = engine.dream(episodes=100, max_steps=30)
# ใช้ dreams ไป train agent (REINFORCE/PPO/SFT)
ดู examples/agent_in_dream.py
3. OpenAI-compatible Server
python scripts/inference.py --host 0.0.0.0 --port 8081
# หรือ
python -m qwen_agent_world.inference.server --gguf "D:\AGI\..." --port 8081
curl http://localhost:8081/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"qwen-agentworld","messages":[{"role":"user","content":"จำลอง WebShop: ..."}]}'
curl http://localhost:8081/v1/world/step -H "Content-Type: application/json" \
-d '{"observation":"...","action":"...","env_spec":"alfworld"}'
World Model API
| Method | สัญญา |
|---|---|
wm.step(obs, action, history, env_spec) |
ทำนายก้าวเดียว → WorldStepResult |
wm.rollout(init_obs, actions, env_spec) |
หลายก้าวต่อเนื่อง |
wm.simulate(agent, env, max_steps) |
ให้ agent เล่นในโลกจำลองจนจบ |
wm.batch_step(requests) |
batch หลาย request พร้อมกัน |
POST /v1/world/step |
HTTP API สำหรับ step |
POST /v1/world/rollout |
HTTP API สำหรับ rollout |
WorldStepResult (qwen_agent_world/world_model.py:28):
@dataclass
class WorldStepResult:
next_observation: str
reward: float
done: bool
info: str
thought: str # โมเดลคิดอะไร (reasoning)
raw_output: str # JSON ดิบ
latency_ms: float
Training
เตรียม dataset (trajectory JSONL)
{"env":"alfworld","observations":["You are in kitchen..."],"actions":["go to table"],"next_observations":["You see apple..."],"rewards":[0],"dones":[false]}
LoRA finetune (แนะนำสำหรับ 27B บน 24GB)
python scripts/train.py --config configs/training.yaml
configs/training.yaml ตั้ง LoRA r=64, alpha=128, dropout=0.05 เฉพาะ q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj + ssm layers, 4-bit quantization (QLoRA) ถ้าใช้ bitsandbytes
Reward Model
from qwen_agent_world.training import RewardModel
rm = RewardModel(base_model="Qwen-AgentWorld")
score = rm.score(observation, action, next_observation) # float
Ollama / llama.cpp
Ollama (Modelfile):
FROM D:\AGI\Qwen3.8-27B-TurboFCFusion-735-882-Here-Uncen-NEO-CODER-MAX-MTP-IQ4_NL.gguf
PARAMETER num_ctx 32768
PARAMETER temperature 0.7
SYSTEM """You are Qwen-AgentWorld, a native language world model..."""
ollama create qwen-agentworld -f Modelfile
ollama run qwen-agentworld "จำลอง ALFWorld: ..."
llama.cpp โดยตรง:
llama-server --model "D:\AGI\Qwen3.8-27B-....gguf" --ctx-size 32768 --n-gpu-layers 65 --port 8080
Evaluation
python scripts/evaluate.py --env alfworld --episodes 50 --max-steps 30
python scripts/benchmark.py --suite all
Metrics (qwen_agent_world/utils/metrics.py):
- Next-obs fidelity: BLEU / ROUGE / BERTScore vs ground truth
- Reward MSE / Accuracy
- Done F1
- Trajectory consistency (rollout หลายก้าวแล้วตรวจ coherence)
- Agent success rate in dream vs real
อ้างอิงสถาปัตยกรรม GGUF
| Key | Value |
|---|---|
general.architecture |
qwen35 |
qwen35.block_count |
65 |
qwen35.context_length |
262144 |
qwen35.embedding_length |
5120 |
qwen35.feed_forward_length |
17408 |
qwen35.attention.head_count |
24 |
qwen35.attention.head_count_kv |
4 (GQA) |
qwen35.rope.freq_base |
10,000,000 |
qwen35.full_attention_interval |
4 |
qwen35.nextn_predict_layers |
1 (MTP) |
tokenizer.ggml.model |
gpt2 (Qwen3) |
general.file_type |
25 (IQ4_NL) |
License & Credits
- Base model weights: ตาม license ของผู้ปล่อย GGUF ต้นทาง (Brainwaves/NM/HERETIC fusion)
- Code ใน
Qwen-AgentWorld/: MIT — สร้างใหม่สำหรับโปรเจกต์นี้ - Qwen3.5 architecture: Alibaba Cloud Qwen team
สร้างเมื่อ 2026-09-04 บน RTX 3090 — D:\AGI
- Downloads last month
- 174
4-bit