CodeBench: qwen3:8b primary-rooliin, FK-esimerkit code-small promptissa
profiles.json: role-kenttä (primary/backup/minimal/retired). code-small.md: lisätty konkreettinen FK-pattern ja testi-esimerkki relaatioille — 8b:n blog-skenaario kaatui koska ei osannut FK:ta.
This commit is contained in:
@@ -2,33 +2,43 @@
|
|||||||
"models": {
|
"models": {
|
||||||
"qwen3-coder:30b": {
|
"qwen3-coder:30b": {
|
||||||
"profile": "large",
|
"profile": "large",
|
||||||
|
"role": "primary",
|
||||||
"prompt": "code",
|
"prompt": "code",
|
||||||
"golden": "todo.md",
|
"golden": "todo.md",
|
||||||
|
"vram": "24GB",
|
||||||
"notes": "Pääkooderi. 97p, 188 tok/s. Noudattaa pitkiä sääntölistoja."
|
"notes": "Pääkooderi. 97p, 188 tok/s. Noudattaa pitkiä sääntölistoja."
|
||||||
},
|
},
|
||||||
"qwen3:8b": {
|
"qwen3:8b": {
|
||||||
"profile": "small",
|
"profile": "small",
|
||||||
|
"role": "primary",
|
||||||
"prompt": "code-small",
|
"prompt": "code-small",
|
||||||
"golden": "todo.md",
|
"golden": "todo.md",
|
||||||
"notes": "Kevyt vaihtoehto. Todo/users 100p, blog heikko. Lyhyt prompti toimii paremmin."
|
"vram": "8GB",
|
||||||
},
|
"notes": "Kevyt pääkooderi. Todo/users 100p, blog heikko. Lyhyt prompti toimii paremmin."
|
||||||
"qwen3:14b": {
|
|
||||||
"profile": "large",
|
|
||||||
"prompt": "code",
|
|
||||||
"golden": "todo.md",
|
|
||||||
"notes": "Poistettu käytöstä. Ei lisäarvoa 30b:hen verrattuna."
|
|
||||||
},
|
},
|
||||||
"codestral:22b": {
|
"codestral:22b": {
|
||||||
"profile": "large",
|
"profile": "large",
|
||||||
|
"role": "backup",
|
||||||
"prompt": "code",
|
"prompt": "code",
|
||||||
"golden": "todo.md",
|
"golden": "todo.md",
|
||||||
|
"vram": "16GB",
|
||||||
"notes": "Mistral-varamalli. 88p, 44 tok/s."
|
"notes": "Mistral-varamalli. 88p, 44 tok/s."
|
||||||
},
|
},
|
||||||
"qwen3:4b": {
|
"qwen3:4b": {
|
||||||
"profile": "small",
|
"profile": "small",
|
||||||
|
"role": "minimal",
|
||||||
"prompt": "code-small",
|
"prompt": "code-small",
|
||||||
"golden": "todo.md",
|
"golden": "todo.md",
|
||||||
|
"vram": "4GB",
|
||||||
"notes": "Minimaali. Vain todo toimii."
|
"notes": "Minimaali. Vain todo toimii."
|
||||||
|
},
|
||||||
|
"qwen3:14b": {
|
||||||
|
"profile": "large",
|
||||||
|
"role": "retired",
|
||||||
|
"prompt": "code",
|
||||||
|
"golden": "todo.md",
|
||||||
|
"vram": "16GB",
|
||||||
|
"notes": "Poistettu. Ei lisäarvoa 30b:hen verrattuna, blog epävakaa."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profiles": {
|
"profiles": {
|
||||||
|
|||||||
@@ -15,6 +15,34 @@ Key patterns (copy from reference):
|
|||||||
- model_dump() not dict()
|
- model_dump() not dict()
|
||||||
- POST 201, GET list, GET by id 404, PUT, DELETE 204
|
- POST 201, GET list, GET by id 404, PUT, DELETE 204
|
||||||
|
|
||||||
|
FOREIGN KEYS (when spec has relationships):
|
||||||
|
- Child entity gets parent_id field: Mapped[int] = mapped_column(ForeignKey("parents.id"))
|
||||||
|
- Import ForeignKey: from sqlalchemy import ForeignKey
|
||||||
|
- Create schema includes parent_id: int
|
||||||
|
- Test creates parent FIRST, then child with parent's id
|
||||||
|
|
||||||
|
Example FK pattern in models.py:
|
||||||
|
```
|
||||||
|
class Author(Base):
|
||||||
|
__tablename__ = "authors"
|
||||||
|
id: Mapped[int] = mapped_column(primary_key=True, index=True)
|
||||||
|
name: Mapped[str] = mapped_column(String(255))
|
||||||
|
|
||||||
|
class Post(Base):
|
||||||
|
__tablename__ = "posts"
|
||||||
|
id: Mapped[int] = mapped_column(primary_key=True, index=True)
|
||||||
|
title: Mapped[str] = mapped_column(String(255))
|
||||||
|
author_id: Mapped[int] = mapped_column(ForeignKey("authors.id"))
|
||||||
|
```
|
||||||
|
|
||||||
|
Example FK test pattern:
|
||||||
|
```
|
||||||
|
def test_create_post():
|
||||||
|
author = client.post("/authors/", json={"name": "Kirjailija"}).json()
|
||||||
|
response = client.post("/posts/", json={"title": "Artikkeli", "author_id": author["id"]})
|
||||||
|
assert response.status_code == 201
|
||||||
|
```
|
||||||
|
|
||||||
CRITICAL:
|
CRITICAL:
|
||||||
- Use ONLY fields from the JSON spec — no created_at or extra fields
|
- Use ONLY fields from the JSON spec — no created_at or extra fields
|
||||||
- Generate EXACTLY 6 tests per entity: create, list, get_by_id, not_found, update, delete
|
- Generate EXACTLY 6 tests per entity: create, list, get_by_id, not_found, update, delete
|
||||||
|
|||||||
Reference in New Issue
Block a user