Skip to content

Commit 7b38b2f

Browse files
authored
Merge pull request #293 from Kiln-AI/main
Update docs for v0.15
2 parents 7244f60 + b07ff3c commit 7b38b2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2319
-333
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
The Kiln desktop app is completely free. Available on MacOS, Windows and Linux.
4646

47-
47+
[<img width="220" alt="Download button" src="https://github.com/user-attachments/assets/a5d51b8b-b30a-4a16-a902-ab6ef1d58dc0">](https://github.com/Kiln-AI/Kiln/releases/latest)
4848

4949
## Demo
5050

app/desktop/WinInnoSetup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define MyAppPath "build\dist\Kiln"
55
#define MyAppName "Kiln"
6-
#define MyAppVersion "0.13.2"
6+
#define MyAppVersion "0.15.0"
77
#define MyAppPublisher "Chesterfield Laboratories Inc"
88
#define MyAppURL "https://getkiln.ai"
99
#define MyAppExeName "Kiln.exe"

app/desktop/studio_server/provider_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ async def connect_gemini(key: str):
555555
async def connect_vertex(project_id: str, project_location: str):
556556
try:
557557
await litellm.acompletion(
558-
model="vertex_ai/gemini-1.5-flash",
558+
model="vertex_ai/gemini-2.0-flash",
559559
messages=[{"content": "Hello, how are you?", "role": "user"}],
560560
vertex_project=project_id,
561561
vertex_location=project_location,

app/desktop/studio_server/repair_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import json
2+
13
from fastapi import FastAPI, HTTPException
24
from kiln_ai.adapters.adapter_registry import adapter_for_task
35
from kiln_ai.adapters.repair.repair_task import RepairTaskRun
46
from kiln_ai.datamodel import TaskRun
7+
from kiln_ai.datamodel.json_schema import validate_schema
8+
from kiln_ai.datamodel.task_output import DataSource, DataSourceType
9+
from kiln_ai.utils.config import Config
510
from kiln_server.run_api import model_provider_from_string, task_and_run_from_id
611
from pydantic import BaseModel, ConfigDict, Field
712

@@ -73,6 +78,15 @@ async def post_repair_run(
7378
project_id: str, task_id: str, run_id: str, input: RepairRunPost
7479
) -> TaskRun:
7580
task, run = task_and_run_from_id(project_id, task_id, run_id)
81+
82+
# manually edited runs are human but the user id is not set
83+
source = input.repair_run.output.source
84+
if not source or source.type == DataSourceType.human:
85+
input.repair_run.output.source = DataSource(
86+
type=DataSourceType.human,
87+
properties={"created_by": Config.shared().user_id},
88+
)
89+
7690
# Update the run object atomically, as validation will fail setting one at a time.
7791
updated_data = run.model_dump()
7892
updated_data.update(

libs/core/kiln_ai/adapters/test_generate_docs.py renamed to app/desktop/studio_server/test_generate_docs.py

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
import logging
21
from typing import List
32

43
import pytest
54

6-
from libs.core.kiln_ai.adapters.ml_model_list import KilnModelProvider, built_in_models
5+
from app.desktop.studio_server.finetune_api import (
6+
FinetuneProviderModel,
7+
fetch_fireworks_finetune_models,
8+
)
9+
from libs.core.kiln_ai.adapters.ml_model_list import (
10+
KilnModelProvider,
11+
ModelProviderName,
12+
built_in_models,
13+
)
714
from libs.core.kiln_ai.adapters.provider_tools import provider_name_from_id
815

9-
logger = logging.getLogger(__name__)
10-
1116

1217
def _all_providers_support(providers: List[KilnModelProvider], attribute: str) -> bool:
1318
"""Check if all providers support a given feature"""
@@ -28,15 +33,30 @@ def _get_support_status(providers: List[KilnModelProvider], attribute: str) -> s
2833
return ""
2934

3035

31-
def _has_finetune_support(providers: List[KilnModelProvider]) -> str:
36+
def _has_finetune_support(
37+
providers: List[KilnModelProvider], fireworks_models: List[FinetuneProviderModel]
38+
) -> str:
3239
"""Check if any provider supports fine-tuning"""
40+
41+
# Check fireworks list
42+
for provider in providers:
43+
if provider.name.value == ModelProviderName.fireworks_ai:
44+
fireworks_id = provider.provider_finetune_id or provider.model_id
45+
for index, model in enumerate(fireworks_models):
46+
if model.id == fireworks_id:
47+
# We could remove the model from the list so we don't list it again
48+
# fireworks_models.pop(index)
49+
return "✅︎"
50+
3351
return "✅︎" if any(p.provider_finetune_id for p in providers) else ""
3452

3553

3654
@pytest.mark.paid(reason="Marking as paid so it isn't run by default")
37-
def test_generate_model_table():
55+
async def test_generate_model_table():
3856
"""Generate a markdown table of all models and their capabilities"""
3957

58+
fireworks_models = await fetch_fireworks_finetune_models()
59+
4060
# Table header
4161
table = [
4262
"| Model Name | Providers | Structured Output | Reasoning | Synthetic Data | API Fine-Tuneable |",
@@ -52,14 +72,16 @@ def test_generate_model_table():
5272
)
5373
reasoning = _get_support_status(model.providers, "reasoning_capable")
5474
data_gen = _get_support_status(model.providers, "supports_data_gen")
55-
finetune = _has_finetune_support(model.providers)
75+
finetune = _has_finetune_support(model.providers, fireworks_models)
5676

5777
row = f"| {model.friendly_name} | {provider_names} | {structured_output} | {reasoning} | {data_gen} | {finetune} |"
5878
table.append(row)
5979

6080
# Print the table (useful for documentation)
6181
print("\nModel Capability Matrix:\n")
6282
print("\n".join(table))
83+
print("\n\nFireworks models remaining:\n")
84+
print("- " + "\n- ".join(f"{m.name}" for m in fireworks_models), "\n\n")
6385

6486
# Basic assertions to ensure the table is well-formed
6587
assert len(table) > 2, "Table should have header and at least one row"

app/desktop/studio_server/test_provider_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ async def test_connect_vertex_success(mock_config_shared, mock_litellm_acompleti
19301930
assert response.status_code == 200
19311931
assert "Connected to Vertex" in response.body.decode()
19321932
mock_litellm_acompletion.assert_called_once_with(
1933-
model="vertex_ai/gemini-1.5-flash",
1933+
model="vertex_ai/gemini-2.0-flash",
19341934
messages=[{"content": "Hello, how are you?", "role": "user"}],
19351935
vertex_project="test-project-id",
19361936
vertex_location="us-central1",
@@ -1955,7 +1955,7 @@ async def test_connect_vertex_failure(mock_config_shared, mock_litellm_acompleti
19551955
assert "Failed to connect to Vertex" in response.body.decode()
19561956
assert "Invalid project ID" in response.body.decode()
19571957
mock_litellm_acompletion.assert_called_once_with(
1958-
model="vertex_ai/gemini-1.5-flash",
1958+
model="vertex_ai/gemini-2.0-flash",
19591959
messages=[{"content": "Hello, how are you?", "role": "user"}],
19601960
vertex_project="invalid-project-id",
19611961
vertex_location="us-central1",

app/desktop/studio_server/test_repair_api.py

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
TaskOutput,
1313
TaskRun,
1414
)
15+
from kiln_ai.utils.config import Config
1516

1617
from app.desktop.studio_server.repair_api import (
1718
RepairRunPost,
@@ -46,13 +47,17 @@ def data_source():
4647

4748

4849
@pytest.fixture
49-
def improvement_task(tmp_path) -> Task:
50+
def project(tmp_path) -> Project:
5051
project_path = tmp_path / "test_project" / "project.kiln"
5152
project_path.parent.mkdir()
5253

5354
project = Project(name="Test Project", path=str(project_path))
5455
project.save_to_file()
56+
return project
5557

58+
59+
@pytest.fixture
60+
def improvement_task(project) -> Task:
5661
task = Task(name="Test Task", instruction="Test Instruction", parent=project)
5762
task.save_to_file()
5863
return task
@@ -83,6 +88,23 @@ def mock_repair_task_run(improvement_task, data_source):
8388
)
8489

8590

91+
@pytest.fixture
92+
def mock_repair_task_run_human_edited(improvement_task, data_source):
93+
return TaskRun(
94+
output=TaskOutput(
95+
output="Test Output",
96+
source={
97+
"type": "human",
98+
"properties": {
99+
"created_by": "placeholder_user_id",
100+
},
101+
},
102+
),
103+
input="The input to the improvement task",
104+
input_source=data_source,
105+
)
106+
107+
86108
@pytest.fixture
87109
def mock_langchain_adapter(mock_repair_task_run):
88110
with patch("app.desktop.studio_server.repair_api.adapter_for_task") as mock:
@@ -180,3 +202,35 @@ def test_repair_run_missing_model_info(
180202
# Assert
181203
assert response.status_code == 400
182204
assert response.json()["detail"] == "Model name and provider must be specified."
205+
206+
207+
def test_repair_run_human_source(
208+
mock_run_and_task,
209+
mock_langchain_adapter,
210+
client,
211+
improvement_task,
212+
mock_repair_task_run_human_edited,
213+
):
214+
# Arrange
215+
input_data = RepairRunPost(
216+
repair_run=mock_repair_task_run_human_edited.model_dump(),
217+
evaluator_feedback="Fix this issue",
218+
)
219+
220+
# Act
221+
response = client.post(
222+
"/api/projects/proj-ID/tasks/task-ID/runs/run-ID/repair",
223+
json=json.loads(input_data.model_dump_json()),
224+
)
225+
226+
# Assert
227+
assert response.status_code == 200
228+
res = response.json()
229+
230+
# source must be set and the created_by must be set to the user id
231+
repaired_output = res["repaired_output"]
232+
assert repaired_output["source"] is not None
233+
assert repaired_output["source"]["properties"] is not None
234+
assert (
235+
repaired_output["source"]["properties"]["created_by"] == Config.shared().user_id
236+
)

app/web_ui/package-lock.json

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

app/web_ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@redocly/cli": "^1.34.1",
1919
"@sveltejs/adapter-static": "^3.0.2",
20-
"@sveltejs/kit": "^2.17.1",
20+
"@sveltejs/kit": "^2.20.6",
2121
"@sveltejs/vite-plugin-svelte": "^3.1.1",
2222
"@tailwindcss/typography": "^0.5.13",
2323
"@typescript-eslint/eslint-plugin": "^6.20.0",
@@ -35,7 +35,7 @@
3535
"svelte-check": "^3.4.3",
3636
"tailwindcss": "^3.4.1",
3737
"typescript": "^5.6.3",
38-
"vite": "^5.4.16",
38+
"vite": "^5.4.18",
3939
"vitest": "^1.6.1"
4040
},
4141
"type": "module",

app/web_ui/src/lib/utils/form_container.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
})
137137
138138
function handleKeydown(event: KeyboardEvent) {
139-
if (!keyboard_submit) {
139+
if (!keyboard_submit || !submit_visible) {
140140
return
141141
}
142142
// Command+Enter (Mac) or Ctrl+Enter (Windows/Linux)

0 commit comments

Comments
 (0)