Text Generation
Transformers
Safetensors
qwen3
agents
tool-use
distillation
nethack
minihack
conversational
text-generation-inference
Instructions to use visproj/lantern-1.7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use visproj/lantern-1.7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="visproj/lantern-1.7b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("visproj/lantern-1.7b") model = AutoModelForCausalLM.from_pretrained("visproj/lantern-1.7b", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use visproj/lantern-1.7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "visproj/lantern-1.7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "visproj/lantern-1.7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/visproj/lantern-1.7b
- SGLang
How to use visproj/lantern-1.7b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "visproj/lantern-1.7b" \ --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": "visproj/lantern-1.7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "visproj/lantern-1.7b" \ --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": "visproj/lantern-1.7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use visproj/lantern-1.7b with Docker Model Runner:
docker model run hf.co/visproj/lantern-1.7b
|
Download README.md from visproj/lantern-1.7b: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/visproj/lantern-1.7b/resolve/main/README.md
- Command line
-
hf download hf://visproj/lantern-1.7b/README.md
-
curl -L -o README.md https://huggingface.co/visproj/lantern-1.7b/resolve/main/README.md
3.08 kB
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-1.7B | |
| datasets: | |
| - visproj/lantern-episodes | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - agents | |
| - tool-use | |
| - distillation | |
| - nethack | |
| - minihack | |
| # Lantern-1.7B | |
| A 1.7B model that plays dungeon levels by calling tools, distilled from [Beam](https://huggingface.co/reflection/Beam-1.0-501B-A23B). It's the student half of [Lantern](https://huggingface.co/spaces/visproj/lantern). | |
| ## How it was made | |
| - **Base model:** [Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B) (Apache-2.0). | |
| - **Teacher:** Beam 1.0 by Reflection (Apache-2.0). Beam's model card states that Reflection doesn't prohibit distillation or using its outputs to train other models. | |
| - **Data:** every Beam call from the winning episodes of the Lantern benchmark: 1,031 examples from 58 episodes across 8 MiniHack levels. Each example is the exact system prompt and observation Beam saw, and the tool calls it made (`act` with a list of moves, and `write_notes`). Only episodes with the current prompt version are used, and runs where a person coached the agent are left out. Data: [visproj/lantern-episodes](https://huggingface.co/datasets/visproj/lantern-episodes). | |
| - **Training:** supervised fine-tuning with TRL, loss on the completion only, 3 epochs, learning rate 1e-5 (cosine), effective batch size 16, bf16, on one A100. Final training loss 0.37. Qwen3's thinking mode is turned off: the student answers with a tool call directly, without Beam's reasoning. | |
| ## Results | |
| Same 8 MiniHack levels × 5 seeds, same prompt and tools, no journal: | |
| | Model | Wins | | |
| |---|---| | |
| | Beam 1.0 (501B, teacher) | 23 / 40 | | |
| | **Lantern-1.7B** | **11 / 40** | | |
| | Qwen3-1.7B, untrained | 2 / 40 | | |
| Per level, the student won Small Room 5/5, Room with Monsters 2/5, Memento 2/5, Key Room 1/5 and Corridors 1/5, and none of River Crossing, Maze Walk or Hide and Seek. Full per-level tables are in the [Space README](https://huggingface.co/spaces/visproj/lantern). | |
| ## How to use it | |
| The model expects Lantern's prompt format and tool schema. Both are in the dataset: each episode's `start` event holds the exact system prompt and tool schema, and each `turn` event holds the observation prompt the model saw. | |
| Serve it with vLLM and send requests in that format, with thinking turned off: | |
| ```bash | |
| vllm serve visproj/lantern-1.7b --enable-auto-tool-choice --tool-call-parser hermes | |
| ``` | |
| Pass `{"chat_template_kwargs": {"enable_thinking": false}}` in the request body. The model replies with `act` or `write_notes` tool calls. | |
| ## Limitations | |
| - It learned only from Beam's wins, so it has seen far fewer examples of recovering from mistakes than of clean play. | |
| - It doesn't reason before acting the way Beam does, which matters most on the long levels. | |
| - It's trained on Lantern's exact observation format. Other prompts or games will need retraining. | |
| - 1,031 examples is a small dataset. Treat this as a proof of concept. | |
| ## License | |
| Apache-2.0, as a fine-tune of Qwen3-1.7B (Apache-2.0). Changes from the base model are described under "How it was made". | |