Skip to content

Commit 1302f59

Browse files
authored
Merge pull request #450 from Kiln-AI/main
Update docs
2 parents 98432c5 + 2fc907e commit 1302f59

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
lines changed

app/desktop/pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
15
[project]
26
name = "kiln-studio-desktop"
37
version = "0.1.0"
@@ -11,6 +15,9 @@ dependencies = [
1115
"scipy>=1.15.2",
1216
]
1317

18+
# We don't really want to build a wheel for desktop, it's a pyinstaller project. This is a minimal build to take care of errors.
19+
[tool.hatch.build.targets.wheel]
20+
only-include = ["__init__.py"]
1421

1522
[tool.uv.sources]
1623
kiln-server = { workspace = true }

app/web_ui/src/routes/(app)/evals/[project_id]/[task_id]/create_evaluator/select_eval_template.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
<FormElement
413413
label="Failure Example - Recommended"
414414
description="An example of model output that should fail the eval."
415-
info_description="Including an example helps the judge model understand the issue."
415+
info_description="Examples help the judge model understand the issue. The format is flexible (plain text); you can include the entire input/output or just the relevant portion. You can include a description or multiple examples if needed."
416416
inputType="textarea"
417417
id="failure_example"
418418
optional={true}
@@ -421,7 +421,7 @@
421421
<FormElement
422422
label="Passing Example"
423423
description="An example of model output that should pass the eval."
424-
info_description="Including an example helps the judge model understand the issue."
424+
info_description="Examples help the judge model understand the issue. The format is flexible (plain text); you can include the entire input/output or just the relevant portion. You can include a description or multiple examples if needed."
425425
inputType="textarea"
426426
id="pass_example"
427427
optional={true}

libs/core/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The library has a [comprehensive set of docs](https://kiln-ai.github.io/Kiln/kil
3232

3333
## Table of Contents
3434

35+
- [Connecting AI Providers](#connecting-ai-providers-openai-openrouter-ollama-etc)
3536
- [Using the Kiln Data Model](#using-the-kiln-data-model)
3637
- [Understanding the Kiln Data Model](#understanding-the-kiln-data-model)
3738
- [Datamodel Overview](#datamodel-overview)
@@ -40,6 +41,7 @@ The library has a [comprehensive set of docs](https://kiln-ai.github.io/Kiln/kil
4041
- [Using your Kiln Dataset in a Notebook or Project](#using-your-kiln-dataset-in-a-notebook-or-project)
4142
- [Using Kiln Dataset in Pandas](#using-kiln-dataset-in-pandas)
4243
- [Building and Running a Kiln Task from Code](#building-and-running-a-kiln-task-from-code)
44+
- [Tagging Task Runs Programmatically](#tagging-task-runs-programmatically)
4345
- [Adding Custom Model or AI Provider from Code](#adding-custom-model-or-ai-provider-from-code)
4446
- [Full API Reference](#full-api-reference)
4547

@@ -49,6 +51,12 @@ The library has a [comprehensive set of docs](https://kiln-ai.github.io/Kiln/kil
4951
pip install kiln-ai
5052
```
5153

54+
## Connecting AI Providers (OpenAI, OpenRouter, Ollama, etc)
55+
56+
The easiest way to connect AI providers is to use the Kiln app UI. Once connected in the UI, credentials will be stored to `~/.kiln_ai/settings.yml`, which will be available to the library.
57+
58+
For configuring credentials from code or connecting custom servers/model, see [Adding Custom Model or AI Provider from Code](#adding-custom-model-or-ai-provider-from-code).
59+
5260
## Using the Kiln Data Model
5361

5462
### Understanding the Kiln Data Model
@@ -146,7 +154,10 @@ item = kiln_ai.datamodel.TaskRun(
146154
type=kiln_ai.datamodel.DataSourceType.human,
147155
properties={"created_by": "Jane Doe"},
148156
),
149-
rating=kiln_ai.datamodel.TaskOutputRating(score=5,type="five_star"),
157+
rating=kiln_ai.datamodel.TaskOutputRating(
158+
value=5,
159+
type=kiln_ai.datamodel.datamodel_enums.five_star,
160+
),
150161
),
151162
)
152163
item.save_to_file()
@@ -237,6 +248,25 @@ for run in task.runs():
237248

238249
```
239250

251+
## Tagging Task Runs Programmatically
252+
253+
You can also tag your Kiln Task runs programmatically:
254+
255+
```py
256+
# Load your Kiln Task from disk
257+
task_path = "/Users/youruser/Kiln Projects/test project/tasks/632780983478 - Joke Generator/task.kiln"
258+
task = kiln_ai.datamodel.Task.load_from_file(task_path)
259+
260+
for run in task.runs():
261+
# Parse the task output from JSON
262+
output = json.loads(run.output.output)
263+
264+
# Add a tag if the punchline is unusually short
265+
if len(output["punchline"]) < 100:
266+
run.tags.append("very_short")
267+
run.save_to_file() # Persist the updated tags
268+
```
269+
240270
### Adding Custom Model or AI Provider from Code
241271

242272
You can add additional AI models and providers to Kiln.

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)