Instructions to use KomorAI/CodeThinker-Python-270M 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 KomorAI/CodeThinker-Python-270M 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 KomorAI/CodeThinker-Python-270M:Q4_K_M # Run inference directly in the terminal: llama cli -hf KomorAI/CodeThinker-Python-270M:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf KomorAI/CodeThinker-Python-270M:Q4_K_M # Run inference directly in the terminal: llama cli -hf KomorAI/CodeThinker-Python-270M:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf KomorAI/CodeThinker-Python-270M:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf KomorAI/CodeThinker-Python-270M:Q4_K_M
Use Docker
docker model run hf.co/KomorAI/CodeThinker-Python-270M:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use KomorAI/CodeThinker-Python-270M with Ollama:
ollama run hf.co/KomorAI/CodeThinker-Python-270M:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use KomorAI/CodeThinker-Python-270M with Docker Model Runner:
docker model run hf.co/KomorAI/CodeThinker-Python-270M:Q4_K_M
- Lemonade
How to use KomorAI/CodeThinker-Python-270M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull KomorAI/CodeThinker-Python-270M:Q4_K_M
Run and chat with the model
lemonade run user.CodeThinker-Python-270M-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,13 +6,44 @@ tags:
|
|
| 6 |
- unsloth
|
| 7 |
---
|
| 8 |
|
| 9 |
-
# CodeThinker-Python-270M
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
**
|
| 14 |
-
- For text only LLMs: `llama-cli -hf KomorAI/CodeThinker-Python-270M --jinja`
|
| 15 |
-
- For multimodal models: `llama-mtmd-cli -hf KomorAI/CodeThinker-Python-270M --jinja`
|
| 16 |
|
| 17 |
-
##
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
- unsloth
|
| 7 |
---
|
| 8 |
|
| 9 |
+
# KomorAI/CodeThinker-Python-270M
|
| 10 |
|
| 11 |
+
Lekki model językowy klasy **270M parametrów** przeznaczony do zadań związanych z **językiem Python** (uzupełnianie kodu, proste funkcje, refaktoryzacja, podstawowe skrypty).
|
| 12 |
|
| 13 |
+
> **Uwaga:** Nazwa *CodeThinker* jest wyłącznie umowna — model **nie posiada wbudowanego trybu reasoning / chain-of-thought** (nie generuje ukrytych ani jawnych łańcuchów rozumowania przed odpowiedzią).
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
## Najważniejsze cechy
|
| 16 |
+
|
| 17 |
+
- **Rozmiar:** ~270M parametrów — niskie zużycie pamięci VRAM/RAM oraz szybka inferencja nawet na słabszym sprzęcie (CPU / GPU klasy consumer).
|
| 18 |
+
- **Specjalizacja:** Python (składnia, biblioteka standardowa, typowe wzorce i krótkie snippet-y).
|
| 19 |
+
- **Brak reasoningu:** Bezpośrednia generacja tokenów wyjściowych bez dedykowanego mechanizmu wieloetapowego wnioskowania.
|
| 20 |
+
|
| 21 |
+
## Szybki start (Transformers)
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
import torch
|
| 25 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 26 |
+
|
| 27 |
+
model_id = "KomorAI/CodeThinker-Python-270M"
|
| 28 |
+
|
| 29 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 30 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 31 |
+
model_id,
|
| 32 |
+
torch_dtype="auto",
|
| 33 |
+
device_map="auto",
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
prompt = "def fibonacci(n: int) -> list[int]:\n"
|
| 37 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 38 |
+
|
| 39 |
+
with torch.no_grad():
|
| 40 |
+
outputs = model.generate(
|
| 41 |
+
**inputs,
|
| 42 |
+
max_new_tokens=128,
|
| 43 |
+
temperature=0.2,
|
| 44 |
+
top_p=0.95,
|
| 45 |
+
do_sample=True,
|
| 46 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|