kiln-ai 0.7.0__py3-none-any.whl → 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of kiln-ai might be problematic. Click here for more details.

@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: kiln-ai
3
+ Version: 0.8.0
4
+ Summary: Kiln AI
5
+ Project-URL: Homepage, https://getkiln.ai
6
+ Project-URL: Repository, https://github.com/Kiln-AI/kiln
7
+ Project-URL: Documentation, https://kiln-ai.github.io/Kiln/kiln_core_docs/kiln_ai.html
8
+ Project-URL: Issues, https://github.com/Kiln-AI/kiln/issues
9
+ Author-email: "Steve Cosman, Chesterfield Laboratories Inc" <scosman@users.noreply.github.com>
10
+ License-File: LICENSE.txt
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: coverage>=7.6.4
18
+ Requires-Dist: jsonschema>=4.23.0
19
+ Requires-Dist: langchain-aws>=0.2.4
20
+ Requires-Dist: langchain-fireworks>=0.2.5
21
+ Requires-Dist: langchain-groq>=0.2.0
22
+ Requires-Dist: langchain-ollama>=0.2.0
23
+ Requires-Dist: langchain-openai>=0.2.4
24
+ Requires-Dist: langchain>=0.3.5
25
+ Requires-Dist: openai>=1.53.0
26
+ Requires-Dist: pdoc>=15.0.0
27
+ Requires-Dist: pydantic>=2.9.2
28
+ Requires-Dist: pytest-benchmark>=5.1.0
29
+ Requires-Dist: pytest-cov>=6.0.0
30
+ Requires-Dist: pyyaml>=6.0.2
31
+ Requires-Dist: typing-extensions>=4.12.2
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Kiln AI Core Library
35
+
36
+ <p align="center">
37
+ <picture>
38
+ <img width="205" alt="Kiln AI Logo" src="https://github.com/user-attachments/assets/5fbcbdf7-1feb-45c9-bd73-99a46dd0a47f">
39
+ </picture>
40
+ </p>
41
+
42
+ [![PyPI - Version](https://img.shields.io/pypi/v/kiln-ai.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/kiln-ai)
43
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kiln-ai.svg)](https://pypi.org/project/kiln-ai)
44
+ [![Docs](https://img.shields.io/badge/docs-pdoc-blue)](https://kiln-ai.github.io/Kiln/kiln_core_docs/index.html)
45
+
46
+ ---
47
+
48
+ ## Installation
49
+
50
+ ```console
51
+ pip install kiln_ai
52
+ ```
53
+
54
+ ## About
55
+
56
+ This package is the Kiln AI core library. There is also a separate desktop application and server package. Learn more about Kiln AI at [getkiln.ai](https://getkiln.ai) and on Github: [github.com/Kiln-AI/kiln](https://github.com/Kiln-AI/kiln).
57
+
58
+ # Guide: Using the Kiln Python Library
59
+
60
+ In this guide we'll walk common examples of how to use the library.
61
+
62
+ ## Documentation
63
+
64
+ The library has a [comprehensive set of docs](https://kiln-ai.github.io/Kiln/kiln_core_docs/index.html).
65
+
66
+ ## Table of Contents
67
+
68
+ - [Using the Kiln Data Model](#using-the-kiln-data-model)
69
+ - [Understanding the Kiln Data Model](#understanding-the-kiln-data-model)
70
+ - [Datamodel Overview](#datamodel-overview)
71
+ - [Load a Project](#load-a-project)
72
+ - [Load an Existing Dataset into a Kiln Task Dataset](#load-an-existing-dataset-into-a-kiln-task-dataset)
73
+ - [Using your Kiln Dataset in a Notebook or Project](#using-your-kiln-dataset-in-a-notebook-or-project)
74
+ - [Using Kiln Dataset in Pandas](#using-kiln-dataset-in-pandas)
75
+ - [Advanced Usage](#advanced-usage)
76
+
77
+ ## Installation
78
+
79
+ ```bash
80
+ pip install kiln-ai
81
+ ```
82
+
83
+ ## Using the Kiln Data Model
84
+
85
+ ### Understanding the Kiln Data Model
86
+
87
+ Kiln projects are simply a directory of files (mostly JSON files with the extension `.kiln`) that describe your project, including tasks, runs, and other data.
88
+
89
+ This dataset design was chosen for several reasons:
90
+
91
+ - Git compatibility: Kiln project folders are easy to collaborate on in git. The filenames use unique IDs to avoid conflicts and allow many people to work in parallel. The files are small and easy to compare using standard diff tools.
92
+ - JSON allows you to easily load and manipulate the data using standard tools (pandas, polars, etc)
93
+
94
+ The Kiln Python library provides a set of Python classes that which help you easily interact with your Kiln dataset. Using the library to load and manipulate your dataset is the fastest way to get started, and will guarantees you don't insert any invalid data into your dataset. There's extensive validation when using the library, so we recommend using it to load and manipulate your dataset over direct JSON manipulation.
95
+
96
+ ### Datamodel Overview
97
+
98
+ - Project: a Kiln Project that organizes related tasks
99
+ - Task: a specific task including prompt instructions, input/output schemas, and requirements
100
+ - TaskRun: a sample (run) of a task including input, output and human rating information
101
+ - DatasetSplit: a frozen collection of task runs divided into train/test/validation splits
102
+ - Finetune: configuration and status tracking for fine-tuning models on task data
103
+
104
+ ### Load a Project
105
+
106
+ Assuming you've created a project in the Kiln UI, you'll have a `project.kiln` file in your `~/Kiln Projects/Project Name` directory.
107
+
108
+ ```python
109
+ from kiln_ai.datamodel import Project
110
+
111
+ project = Project.load_from_file("path/to/your/project.kiln")
112
+ print("Project: ", project.name, " - ", project.description)
113
+
114
+ # List all tasks in the project, and their dataset sizes
115
+ tasks = project.tasks()
116
+ for task in tasks:
117
+ print("Task: ", task.name, " - ", task.description)
118
+ print("Total dataset size:", len(task.runs()))
119
+ ```
120
+
121
+ ### Load an Existing Dataset into a Kiln Task Dataset
122
+
123
+ If you already have a dataset in a file, you can load it into a Kiln project.
124
+
125
+ **Important**: Kiln will validate the input and output schemas, and ensure that each datapoint in the dataset is valid for this task.
126
+
127
+ - Plaintext input/output: ensure "output_json_schema" and "input_json_schema" not set in your Task definition.
128
+ - JSON input/output: ensure "output_json_schema" and "input_json_schema" are valid JSON schemas in your Task definition. Every datapoint in the dataset must be valid JSON fitting the schema.
129
+
130
+ Here's a simple example of how to load a dataset into a Kiln task:
131
+
132
+ ```python
133
+
134
+ import kiln_ai
135
+ import kiln_ai.datamodel
136
+
137
+ # Created a project and task via the UI and put its path here
138
+ task_path = "/Users/youruser/Kiln Projects/test project/tasks/632780983478 - Joke Generator/task.kiln"
139
+ task = kiln_ai.datamodel.Task.load_from_file(task_path)
140
+
141
+ # Add data to the task - loop over you dataset and run this for each item
142
+ item = kiln_ai.datamodel.TaskRun(
143
+ parent=task,
144
+ input='{"topic": "AI"}',
145
+ output=kiln_ai.datamodel.TaskOutput(
146
+ output='{"setup": "What is AI?", "punchline": "content_here"}',
147
+ ),
148
+ )
149
+ item.save_to_file()
150
+ print("Saved item to file: ", item.path)
151
+ ```
152
+
153
+ And here's a more complex example of how to load a dataset into a Kiln task. This example sets the source of the data (human in this case, but you can also set it be be synthetic), the created_by property, and a 5-star rating.
154
+
155
+ ```python
156
+ import kiln_ai
157
+ import kiln_ai.datamodel
158
+
159
+ # Created a project and task via the UI and put its path here
160
+ task_path = "/Users/youruser/Kiln Projects/test project/tasks/632780983478 - Joke Generator/task.kiln"
161
+ task = kiln_ai.datamodel.Task.load_from_file(task_path)
162
+
163
+ # Add data to the task - loop over you dataset and run this for each item
164
+ item = kiln_ai.datamodel.TaskRun(
165
+ parent=task,
166
+ input='{"topic": "AI"}',
167
+ input_source=kiln_ai.datamodel.DataSource(
168
+ type=kiln_ai.datamodel.DataSourceType.human,
169
+ properties={"created_by": "John Doe"},
170
+ ),
171
+ output=kiln_ai.datamodel.TaskOutput(
172
+ output='{"setup": "What is AI?", "punchline": "content_here"}',
173
+ source=kiln_ai.datamodel.DataSource(
174
+ type=kiln_ai.datamodel.DataSourceType.human,
175
+ properties={"created_by": "Jane Doe"},
176
+ ),
177
+ rating=kiln_ai.datamodel.TaskOutputRating(score=5,type="five_star"),
178
+ ),
179
+ )
180
+ item.save_to_file()
181
+ print("Saved item to file: ", item.path)
182
+ ```
183
+
184
+ ### Using your Kiln Dataset in a Notebook or Project
185
+
186
+ You can use your Kiln dataset in a notebook or project by loading the dataset into a pandas dataframe.
187
+
188
+ ```python
189
+ import kiln_ai
190
+ import kiln_ai.datamodel
191
+
192
+ # Created a project and task via the UI and put its path here
193
+ task_path = "/Users/youruser/Kiln Projects/test project/tasks/632780983478 - Joke Generator/task.kiln"
194
+ task = kiln_ai.datamodel.Task.load_from_file(task_path)
195
+
196
+ runs = task.runs()
197
+ for run in runs:
198
+ print(f"Input: {run.input}")
199
+ print(f"Output: {run.output.output}")
200
+
201
+ print(f"Total runs: {len(runs)}")
202
+ ```
203
+
204
+ ### Using Kiln Dataset in Pandas
205
+
206
+ You can also use your Kiln dataset in a pandas dataframe, or a similar script for other tools like polars.
207
+
208
+ ```python
209
+ import glob
210
+ import json
211
+ import pandas as pd
212
+ from pathlib import Path
213
+
214
+ task_dir = "/Users/youruser/Kiln Projects/test project/tasks/632780983478 - Joke Generator"
215
+ dataitem_glob = task_dir + "/runs/*/task_run.kiln"
216
+
217
+ dfs = []
218
+ for file in glob.glob(dataitem_glob):
219
+ js = json.loads(Path(file).read_text())
220
+
221
+ df = pd.DataFrame([{
222
+ "input": js["input"],
223
+ "output": js["output"]["output"],
224
+ }])
225
+
226
+ # Alternatively: you can use pd.json_normalize(js) to get the full json structure
227
+ # df = pd.json_normalize(js)
228
+ dfs.append(df)
229
+ final_df = pd.concat(dfs, ignore_index=True)
230
+ print(final_df)
231
+ ```
232
+
233
+ ### Advanced Usage
234
+
235
+ The library can do a lot more than the examples we've shown here.
236
+
237
+ See the [docs](https://kiln-ai.github.io/Kiln/kiln_core_docs/index.html) for more information.
@@ -1,17 +1,17 @@
1
1
  kiln_ai/__init__.py,sha256=Sc4z8LRVFMwJUoc_DPVUriSXTZ6PO9MaJ80PhRbKyB8,34
2
2
  kiln_ai/adapters/__init__.py,sha256=8-YlnTh3gsaPeEArFVLIqGE7-tbssI42fub4OQBp_DA,970
3
- kiln_ai/adapters/adapter_registry.py,sha256=EnB0rUIZ0KbBd2nxkNjwUqOpldwqPDyJ9LzIQoDl2GU,634
4
- kiln_ai/adapters/base_adapter.py,sha256=E_RfXxzEhW-i066xOhZdPuTM7OPKQv70hDpfMsxfYEs,6145
5
- kiln_ai/adapters/langchain_adapters.py,sha256=NeTZ8WbQTnVu8rtFX6AwkdjFj2ihyhe_vxNxM-_v2yE,10584
6
- kiln_ai/adapters/ml_model_list.py,sha256=jU0Qd3B8vDLTeZcNnM2amF0-fWwLUBk7eayY27YAGDU,24196
7
- kiln_ai/adapters/ollama_tools.py,sha256=qja3W4Ubtlw1R1E1_YgSexvtWZ7OanLldYfOdFGTMJ4,3521
3
+ kiln_ai/adapters/adapter_registry.py,sha256=zO-0_CWF3ZGA-1420_0Uwq976o3-7WXxEY_aTeu0PzQ,688
4
+ kiln_ai/adapters/base_adapter.py,sha256=POSdMrZFqd0IJnLpVoyc1w9CGhdNtePZyQPgdBBRUpQ,6276
5
+ kiln_ai/adapters/langchain_adapters.py,sha256=S9VZ9JLBDEue-vh00iNv4wM1rdBQRNnF0ubeOFLAdZc,10861
6
+ kiln_ai/adapters/ml_model_list.py,sha256=Fl8PUlecibRjcWkKFwfge4cFz7jusVMeK35ewaWw8ac,25446
7
+ kiln_ai/adapters/ollama_tools.py,sha256=0Of6ySbJ2d4j--9laOL6QKgRUQSrqX8dJUIrz20n59s,3561
8
8
  kiln_ai/adapters/prompt_builders.py,sha256=Mdu-f1mC9hWIDwoF7Qwd9F99GDx6oNGvtEZN-SrOsNM,10325
9
- kiln_ai/adapters/provider_tools.py,sha256=BVNhXNtFOG-qz1mj1Q94KG2MfZo-rLoH2pqwKt9Ldi0,10209
10
- kiln_ai/adapters/test_langchain_adapter.py,sha256=-6ZUI94jsgDsLcuCVyhx9gC50vcC2oLGF-Wa3rGcZzI,5672
9
+ kiln_ai/adapters/provider_tools.py,sha256=m7X93DFbnYnw5H2HDumFJKpTKmeau-GZLv-SUmssJZ0,12381
10
+ kiln_ai/adapters/test_langchain_adapter.py,sha256=QiVdCUJJ_uEzD0uA0jYMC3ZO4NTGJLm9iWTwvQfdFxI,12037
11
11
  kiln_ai/adapters/test_ollama_tools.py,sha256=2KwYVaj3ySV3ld-z51TCGbJEMdb3MZj2eoEicIWz3Q4,2552
12
12
  kiln_ai/adapters/test_prompt_adaptors.py,sha256=Mc0oSYgDLxfP2u3GVR_iDWaYctTQ8Ug1u6UGvWA90lM,7494
13
13
  kiln_ai/adapters/test_prompt_builders.py,sha256=sU0bSBZa9Y4Q-mmkDf3HbQ0MNSWk5o9bC9sNgtnBokk,14598
14
- kiln_ai/adapters/test_provider_tools.py,sha256=LRH7QvleIEVA6Nkvfq79R6tDGPcI8QtmOqe0LQhQmFw,9948
14
+ kiln_ai/adapters/test_provider_tools.py,sha256=S1PSXd5MJnPvBe7Hq4FijptB0lbmym2E6iztncAvuUg,20752
15
15
  kiln_ai/adapters/test_saving_adapter_results.py,sha256=SYYh2xY1zmeKhFHfWAuEY4pEiLd8SitSV5ewGOTmaOI,6447
16
16
  kiln_ai/adapters/test_structured_output.py,sha256=9Mgng-HOXiZ_WcJG5cpMWhtsdJt8Rn-7qIouBWvWVoU,9324
17
17
  kiln_ai/adapters/data_gen/__init__.py,sha256=QTZWaf7kq5BorhPvexJfwDEKmjRmIbhwW9ei8LW2SIs,276
@@ -29,28 +29,30 @@ kiln_ai/adapters/fine_tune/test_dataset_formatter.py,sha256=7atbHb4kFtgSmHQMNrSn
29
29
  kiln_ai/adapters/fine_tune/test_fireworks_tinetune.py,sha256=Y6r5BxsevFeEUHJikfFLeeG6fbPvLOxQpqIMpn-SpvU,15272
30
30
  kiln_ai/adapters/fine_tune/test_openai_finetune.py,sha256=EF-f0JbVaPiVXF0eBYbwTKdi5thA45s-XbVB0iUBI00,16629
31
31
  kiln_ai/adapters/repair/__init__.py,sha256=dOO9MEpEhjiwzDVFg3MNfA2bKMPlax9iekDatpTkX8E,217
32
- kiln_ai/adapters/repair/repair_task.py,sha256=VXvX1l9AYDE_GV0i3S_vPThltJoQlCFVCCHV9m-QA7k,3297
32
+ kiln_ai/adapters/repair/repair_task.py,sha256=L7WTFEpfaGpWXHPQf7BTNL0wiDPbeBIVqn7qNV_SeZc,3354
33
33
  kiln_ai/adapters/repair/test_repair_task.py,sha256=JBcyqyQYWniiUo4FSle9kUEsnbTsl5JN1LTRN1SRnrE,7940
34
- kiln_ai/datamodel/__init__.py,sha256=Fp8sdRrRLBt8alWc93jiHApv8uwTz_DHRSMcviWo2Ok,22484
35
- kiln_ai/datamodel/basemodel.py,sha256=OedsYQ0-RJ8k4Zl1VslG1xmbJu76WxT7IWQ_wlibuKc,18657
34
+ kiln_ai/datamodel/__init__.py,sha256=-PZpxuOPEU3Tkh2_t_Si7mz8cyrRfUn8B-Eui1eIXD0,28197
35
+ kiln_ai/datamodel/basemodel.py,sha256=zWyoYgsA2tmP55jl9H18xQ0yl9vM98aTOFJTUnW5ulU,20984
36
36
  kiln_ai/datamodel/json_schema.py,sha256=l4BIq1ItLHgcSHqsqDOchegLLHY48U4yR0SP2aMb4i0,2449
37
+ kiln_ai/datamodel/model_cache.py,sha256=d8VjPp0p5BhrGSkx9soKyxO6VWW-bcesNSJI21ySvmA,4369
37
38
  kiln_ai/datamodel/registry.py,sha256=XwGFXJFKZtOpR1Z9ven6SftggfADdZRm8TFxCEVtfUQ,957
38
- kiln_ai/datamodel/test_basemodel.py,sha256=S2-BaqVEaEqzk7otuKdGw3i5ERT2m8MSZHlk4Dy0nyc,10466
39
- kiln_ai/datamodel/test_dataset_split.py,sha256=aBjHVyTdt4mWXEKBkvvchEEZSj8jUwhXRZ37LbBxTi4,7265
39
+ kiln_ai/datamodel/test_basemodel.py,sha256=r40jWaW1073ZdIhHe-GHFE8jJDD9ocauItInOsK8pWU,15234
40
+ kiln_ai/datamodel/test_dataset_split.py,sha256=Ug-vbga-opGN_LF51Mszx5NN4wXbx3MIP1LiNzIn5Nw,7264
40
41
  kiln_ai/datamodel/test_datasource.py,sha256=GAiZz31qezVVPwFqnt8wHMu15WvtlV89jw8C1Ue6YNI,3165
41
42
  kiln_ai/datamodel/test_example_models.py,sha256=9Jhc0bvbM4hCjJGiQNgWH5rwyIsGuneAD8h4o1P3zAY,20356
42
43
  kiln_ai/datamodel/test_json_schema.py,sha256=vdLnTQxxrcmuSrf6iOmkrmpfh7JnxqIw4B4dbDAAcZ4,3199
43
- kiln_ai/datamodel/test_models.py,sha256=iqwE4iW695BVoDnOSg-HUiXOuuzOZIfsvdaYht7qBm4,9441
44
+ kiln_ai/datamodel/test_model_cache.py,sha256=9HvK2etVZJyepdlRz5ja7u1CnyzhsV4_BupJF77yBxE,7285
45
+ kiln_ai/datamodel/test_models.py,sha256=t2Uthl559QioTyFAbQUk4BD3PqAywl3u1RSh4tHiMP0,15071
44
46
  kiln_ai/datamodel/test_nested_save.py,sha256=xciCddqvPyKyoyjC5Lx_3Kh1t4LJv1xYRAPazR3SRcs,5588
45
- kiln_ai/datamodel/test_output_rating.py,sha256=iw7fVUAPORA-0-VFiikZV3NDycGFaFMHSX1a38t_aQA,2647
47
+ kiln_ai/datamodel/test_output_rating.py,sha256=zvPIp2shAgCs2RQBgwYoL09fRA3krHvgAqUa91RlWR0,15125
46
48
  kiln_ai/datamodel/test_registry.py,sha256=PhS4anLi5Bf_023obuTlO5DALhtPB8WIc_bX12Yg6Po,2705
47
49
  kiln_ai/utils/__init__.py,sha256=PTD0MwBCKAMIOGsTAwsFaJOusTJJoRFTfOGqRvCaU-E,142
48
- kiln_ai/utils/config.py,sha256=voYp5NwESKm4ZdTAq6MttQCNcLYEA_1w5zB2Eth9-gg,5803
50
+ kiln_ai/utils/config.py,sha256=u289b2AHuQoPup_vILTSpgsO29fxJyU8zy8BwADAtvs,6859
49
51
  kiln_ai/utils/formatting.py,sha256=VtB9oag0lOGv17dwT7OPX_3HzBfaU9GsLH-iLete0yM,97
50
52
  kiln_ai/utils/name_generator.py,sha256=v26TgpCwQbhQFcZvzgjZvURinjrOyyFhxpsI6NQrHKc,1914
51
- kiln_ai/utils/test_config.py,sha256=pTYItz5WD15rTRdxKE7vszXF_mb-dik2qrFWzkVemEY,7671
53
+ kiln_ai/utils/test_config.py,sha256=Jw3nMFeIgZUsZDRJJY2HpB-2EkR2NoZ-rDe_o9oA7ws,9174
52
54
  kiln_ai/utils/test_name_geneator.py,sha256=9-hSTBshyakqlPbFnNcggwLrL7lcPTitauBYHg9jFWI,1513
53
- kiln_ai-0.7.0.dist-info/METADATA,sha256=V3_VmqXJrKcHyWnfcU7xPoIFhXbbDLm04hVciUJn_f8,3064
54
- kiln_ai-0.7.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
55
- kiln_ai-0.7.0.dist-info/licenses/LICENSE.txt,sha256=_NA5pnTYgRRr4qH6lE3X-TuZJ8iRcMUi5ASoGr-lEx8,1209
56
- kiln_ai-0.7.0.dist-info/RECORD,,
55
+ kiln_ai-0.8.0.dist-info/METADATA,sha256=SQT8m0s7C_06qbwGyrzeeu2X6x-mctP-fHhkNiRrrAA,9050
56
+ kiln_ai-0.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
+ kiln_ai-0.8.0.dist-info/licenses/LICENSE.txt,sha256=_NA5pnTYgRRr4qH6lE3X-TuZJ8iRcMUi5ASoGr-lEx8,1209
58
+ kiln_ai-0.8.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,90 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: kiln-ai
3
- Version: 0.7.0
4
- Summary: Kiln AI
5
- Project-URL: Homepage, https://getkiln.ai
6
- Project-URL: Repository, https://github.com/Kiln-AI/kiln
7
- Project-URL: Documentation, https://kiln-ai.github.io/Kiln/kiln_core_docs/kiln_ai.html
8
- Project-URL: Issues, https://github.com/Kiln-AI/kiln/issues
9
- Author-email: "Steve Cosman, Chesterfield Laboratories Inc" <scosman@users.noreply.github.com>
10
- Classifier: Intended Audience :: Developers
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Requires-Python: >=3.10
17
- Requires-Dist: coverage>=7.6.4
18
- Requires-Dist: jsonschema>=4.23.0
19
- Requires-Dist: langchain-aws>=0.2.4
20
- Requires-Dist: langchain-fireworks>=0.2.5
21
- Requires-Dist: langchain-groq>=0.2.0
22
- Requires-Dist: langchain-ollama>=0.2.0
23
- Requires-Dist: langchain-openai>=0.2.4
24
- Requires-Dist: langchain>=0.3.5
25
- Requires-Dist: openai>=1.53.0
26
- Requires-Dist: pdoc>=15.0.0
27
- Requires-Dist: pydantic>=2.9.2
28
- Requires-Dist: pytest-cov>=6.0.0
29
- Requires-Dist: pyyaml>=6.0.2
30
- Requires-Dist: typing-extensions>=4.12.2
31
- Description-Content-Type: text/markdown
32
-
33
- # Kiln AI Core Library
34
-
35
- <p align="center">
36
- <picture>
37
- <img width="205" alt="Kiln AI Logo" src="https://github.com/user-attachments/assets/5fbcbdf7-1feb-45c9-bd73-99a46dd0a47f">
38
- </picture>
39
- </p>
40
-
41
- [![PyPI - Version](https://img.shields.io/pypi/v/kiln-ai.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/kiln-ai)
42
- [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kiln-ai.svg)](https://pypi.org/project/kiln-ai)
43
- [![Docs](https://img.shields.io/badge/docs-pdoc-blue)](https://kiln-ai.github.io/Kiln/kiln_core_docs/index.html)
44
-
45
- ---
46
-
47
- ## Installation
48
-
49
- ```console
50
- pip install kiln_ai
51
- ```
52
-
53
- ## About
54
-
55
- This package is the Kiln AI core library. There is also a separate desktop application and server package. Learn more about Kiln AI at [getkiln.ai](https://getkiln.ai)
56
-
57
- - Github: [github.com/Kiln-AI/kiln](https://github.com/Kiln-AI/kiln)
58
- - Core Library Docs: [https://kiln-ai.github.io/Kiln/kiln_core_docs/index.html](https://kiln-ai.github.io/Kiln/kiln_core_docs/index.html)
59
-
60
- ## Quick Start
61
-
62
- ```python
63
- from kiln_ai.datamodel import Project
64
-
65
- print("Reading Kiln project")
66
- project = Project.load_from_file("path/to/project.kiln")
67
- print("Project: ", project.name, " - ", project.description)
68
-
69
- task = project.tasks()[0]
70
- print("Task: ", task.name, " - ", task.description)
71
- print("Total dataset size:", len(task.runs()))
72
-
73
- # ... app specific code using the typed kiln datamodel
74
-
75
- # Alternatively, load data into pandas or a similar tool:
76
- import glob
77
- import json
78
- import pandas as pd
79
- from pathlib import Path
80
-
81
- dataitem_glob = str(task.path.parent) + "/runs/*/task_run.kiln"
82
-
83
- dfs = []
84
- for file in glob.glob(dataitem_glob):
85
- js = json.loads(Path(file).read_text())
86
- df = pd.json_normalize(js)
87
- dfs.append(df)
88
- final_df = pd.concat(dfs, ignore_index=True)
89
- print(final_df)
90
- ```