151 lines
3.7 KiB
Markdown
151 lines
3.7 KiB
Markdown
|
|
---
|
||
|
|
license: apache-2.0
|
||
|
|
language:
|
||
|
|
- en
|
||
|
|
base_model:
|
||
|
|
- Qwen/Qwen2.5-Coder-1.5B
|
||
|
|
pipeline_tag: text-generation
|
||
|
|
library_name: transformers
|
||
|
|
tags:
|
||
|
|
- coder
|
||
|
|
- mini
|
||
|
|
- reasoning
|
||
|
|
- o1
|
||
|
|
---
|
||
|
|
|
||
|
|
# Coder-o1-mini-reasoning
|
||
|
|
|
||
|
|
A compact Python-focused reasoning model designed for coding assistance, debugging, code explanation, math reasoning, logic reasoning, Python concept explanation, and tool-style web search workflows.
|
||
|
|
|
||
|
|
The model is intended for lightweight assistant use cases where users need clear explanations, step-by-step reasoning, beginner-friendly Python help, and practical debugging support.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Capabilities
|
||
|
|
|
||
|
|
This model can help with:
|
||
|
|
|
||
|
|
* Python coding assistance
|
||
|
|
* Python code explanation
|
||
|
|
* Python debugging and error fixing
|
||
|
|
* Python concept explanation
|
||
|
|
* Basic to intermediate competitive programming
|
||
|
|
* Math reasoning
|
||
|
|
* Logic reasoning
|
||
|
|
* Beginner-friendly programming guidance
|
||
|
|
* General chat
|
||
|
|
* Web search tool-call style conversations
|
||
|
|
* Multi-turn coding discussion
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Chat Format
|
||
|
|
|
||
|
|
The model follows a Harmony-style chat structure.
|
||
|
|
|
||
|
|
Supported interaction flow:
|
||
|
|
|
||
|
|
```text
|
||
|
|
system -> developer -> user -> reasoning -> tool call -> tool result -> final response
|
||
|
|
```
|
||
|
|
|
||
|
|
For normal chat or coding use, you can use a standard chat-template style prompt.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Basic Usage
|
||
|
|
|
||
|
|
```python
|
||
|
|
import torch
|
||
|
|
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||
|
|
|
||
|
|
MODEL_PATH = "kd13/Coder-o1-mini-reasoning"
|
||
|
|
|
||
|
|
tok = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)
|
||
|
|
model = AutoModelForCausalLM.from_pretrained(
|
||
|
|
MODEL_PATH,
|
||
|
|
torch_dtype=torch.float16,
|
||
|
|
device_map="auto",
|
||
|
|
trust_remote_code=True
|
||
|
|
)
|
||
|
|
model.eval()
|
||
|
|
|
||
|
|
if tok.pad_token is None:
|
||
|
|
tok.pad_token = tok.eos_token
|
||
|
|
|
||
|
|
IM_END_ID = tok.convert_tokens_to_ids("<|im_end|>")
|
||
|
|
if IM_END_ID is None or IM_END_ID == tok.unk_token_id:
|
||
|
|
IM_END_ID = tok.eos_token_id
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Web Search Tool-Call Style
|
||
|
|
|
||
|
|
The model can be used in tool-calling style conversations where the assistant decides when search is needed, emits a tool call, receives a tool result, and then writes the final answer.
|
||
|
|
|
||
|
|
Example structure:
|
||
|
|
|
||
|
|
```text
|
||
|
|
system: You are a helpful assistant with access to web search.
|
||
|
|
user: Find the latest information about a topic.
|
||
|
|
assistant reasoning: Decide whether search is needed.
|
||
|
|
assistant tool call: search(...)
|
||
|
|
tool result: ...
|
||
|
|
assistant final: Answer using the search result.
|
||
|
|
```
|
||
|
|
|
||
|
|
Actual tool execution depends on your inference framework or application wrapper.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Recommended Use Cases
|
||
|
|
|
||
|
|
This model is best suited for:
|
||
|
|
|
||
|
|
* Python learning assistants
|
||
|
|
* Coding tutor apps
|
||
|
|
* Debugging helpers
|
||
|
|
* Interview preparation
|
||
|
|
* Beginner-to-intermediate Python problem solving
|
||
|
|
* Math and logic explanation
|
||
|
|
* Lightweight reasoning chatbots
|
||
|
|
* Tool-call research experiments
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Limitations
|
||
|
|
|
||
|
|
This model is not recommended for:
|
||
|
|
|
||
|
|
* Very hard competitive programming problems
|
||
|
|
* Advanced game theory problems
|
||
|
|
* Complex graph theory or math-heavy algorithmic tasks
|
||
|
|
* Production-critical software generation without review
|
||
|
|
* Non-Python coding tasks such as C++, Java, Rust, Go, or JavaScript
|
||
|
|
* Security-sensitive code generation
|
||
|
|
* Medical, legal, or financial decision-making
|
||
|
|
* Long multi-file software engineering tasks
|
||
|
|
|
||
|
|
The model may sometimes:
|
||
|
|
|
||
|
|
* Produce incorrect reasoning
|
||
|
|
* Miss edge cases
|
||
|
|
* Over-explain simple problems
|
||
|
|
* Generate code that needs testing
|
||
|
|
* Struggle with very long context
|
||
|
|
* Use tool-call format inconsistently depending on the prompt
|
||
|
|
|
||
|
|
Always test generated code before using it.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## License
|
||
|
|
|
||
|
|
Please check the model repository license before commercial or production use.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Disclaimer
|
||
|
|
|
||
|
|
This model is an experimental small reasoning and coding assistant. It should be used as a helpful assistant, not as a guaranteed source of truth. For important tasks, verify outputs with tests, documentation, and human review.
|