Instructions to use lewisdog/qwen3-1.7b-cogs-ask with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lewisdog/qwen3-1.7b-cogs-ask with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lewisdog/qwen3-1.7b-cogs-ask") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lewisdog/qwen3-1.7b-cogs-ask") model = AutoModelForCausalLM.from_pretrained("lewisdog/qwen3-1.7b-cogs-ask") 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]:])) - MLX
How to use lewisdog/qwen3-1.7b-cogs-ask with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("lewisdog/qwen3-1.7b-cogs-ask") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use lewisdog/qwen3-1.7b-cogs-ask with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lewisdog/qwen3-1.7b-cogs-ask" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lewisdog/qwen3-1.7b-cogs-ask", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lewisdog/qwen3-1.7b-cogs-ask
- SGLang
How to use lewisdog/qwen3-1.7b-cogs-ask 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 "lewisdog/qwen3-1.7b-cogs-ask" \ --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": "lewisdog/qwen3-1.7b-cogs-ask", "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 "lewisdog/qwen3-1.7b-cogs-ask" \ --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": "lewisdog/qwen3-1.7b-cogs-ask", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi
How to use lewisdog/qwen3-1.7b-cogs-ask with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lewisdog/qwen3-1.7b-cogs-ask"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "lewisdog/qwen3-1.7b-cogs-ask" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use lewisdog/qwen3-1.7b-cogs-ask with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lewisdog/qwen3-1.7b-cogs-ask"
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 lewisdog/qwen3-1.7b-cogs-ask
Run Hermes
hermes
- OpenClaw new
How to use lewisdog/qwen3-1.7b-cogs-ask with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lewisdog/qwen3-1.7b-cogs-ask"
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 "lewisdog/qwen3-1.7b-cogs-ask" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use lewisdog/qwen3-1.7b-cogs-ask with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "lewisdog/qwen3-1.7b-cogs-ask"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "lewisdog/qwen3-1.7b-cogs-ask" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lewisdog/qwen3-1.7b-cogs-ask", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use lewisdog/qwen3-1.7b-cogs-ask with Docker Model Runner:
docker model run hf.co/lewisdog/qwen3-1.7b-cogs-ask
qwen3-1.7b-cogs-ask
Merged full model (Qwen/Qwen3-1.7B + LoRA, fused, bf16) — the student model
for the cogs ask pipeline. Standalone
adapter: lewisdog/qwen3-1.7b-cogs-ask-lora.
Sibling model for the ingest pipeline:
lewisdog/qwen3-1.7b-cogs-ingest.
Two tasks, both emitting compact JSON exactly as the cogs runtime parses it:
| task | output JSON |
|---|---|
decompose |
{"subquestions": [...]} — question → 1-4 sub-questions |
synthesize |
{"answer": "... [note-id] ...", "citations": [...], "abstained": bool} — grounded answer over retrieved notes; abstains on out-of-domain questions |
Eval (full 63-record valid set, temp 0, repetition_penalty 1.1)
- JSON parse: 100% · decompose non-empty: 100%
- synthesize citation-validity: 77% (→ ~90% with the prefix-repair below)
- abstention preserved: 100% · false-abstention: 4%
Apple silicon (MLX / omlx)
python3 -m mlx_lm.convert --hf-path lewisdog/qwen3-1.7b-cogs-ask -q --q-bits 8 --mlx-path qwen3-cogs-ask-mlx
# NOTE: if transformers writes v5-format configs, backfill rope_theta / rope_scaling /
# torch_dtype from the base Qwen3-1.7B config and swap in the original Qwen3-1.7B
# tokenizer files before converting. Wire as [llm.ask] in cogs.toml.
⚠️ Serving notes
Decode at temp 0 +
repetition_penalty=1.1(pure greedy runs away on long list outputs),enable_thinking=False, stop on<|im_end|>.Repair citation prefixes. Most citation errors are a dropped/wrong namespace prefix (
enisa-…→sources-enisa-…). Normalize against the notes actually in the prompt and drop anything unverifiable:PFX = ("sources-", "source-", "concepts-", "concept-", "entities-", "entity-") core = lambda x: next((x[len(p):] for p in PFX if x.startswith(p)), x) def repair(cite, note_ids): if cite in note_ids: return cite return {core(n): n for n in note_ids}.get(core(cite)) # None => drop itAbstention is reliable — trust it to decline out-of-domain questions.
Training
LoRA r=32/α=64, 5 epochs, eff. batch 16, max_seq 8192, lr 1e-4 cosine, bf16, on a
DGX Spark (GB10). Data: cogs distill ask pairs (475 base + abstentions
oversampled 3×). Eval loss 1.906 → 0.758; eval token-acc 0.836. Full write-up in
the repo RESULTS.md.
- PEFT 0.19.1 · TRL 1.7.1 · Transformers 5.13.0 · PyTorch 2.12.1+cu130
- Downloads last month
- 162
Quantized