Kiln is an app for building AI systems. It includes evals, synthetic data gen, fine tuning, RAG, and more. It has an intuitive UI as well as a python library.
This repo is a monorepo containing all of the source code, in the following structure:
- libs/core - a python library with the core functionality of Kiln
- libs/server - a FastAPI REST server wrapping the core library
- app/web_ui - our svelte web app for Kiln. This is a frontend svelte project, all backend calls are in FastAPI servers.
- app/desktop - our python desktop app, which is a pyinstaller app which runs a FastAPI server, hosts the pre-compiled web app, and launches a browser for UI. Compiles to all major platforms. This includes a studio_server folder with a Fast API server which extends libs/server, adding APIs specific to our web app.
- Very high code quality
- Strongly typed
- Well tested
- Very intuitive UI. Accessible to the inexperienced, but powerful for the experienced.
- Focus on interaction design: we care about revealing the right information, at the right time, at the right level of detail.
- Focus on visual design: we want a modern, functional, attractive UI. Think Apple not Google.
- Backend: python (3.10+ for library, 3.13 for desktop), pytest, FastAPI, asyncio, pydantic (v2 not v1),
- Frontend web: typescript, svelte (v4 not v5), tailwind, DaisyUI
Agents have access to a range of tools for running tests, linting, formatting and typechecking. Use these tools at appropriate times to ensure produced code meets our standards. All checks must pass before merging. When iterating on a specific failure, use the targeted command before re-running the full suite.
- All checks:
uv run ./checks.sh --agent-mode(agent mode suppresses output unless there's a failure)
| Check | Fix | Description |
|---|---|---|
uv run ruff check |
uv run ruff check --fix |
Python lint |
uv run ruff format --check . |
uv run ruff format . |
Python format |
uv run ty check |
— | Python type check |
uv run python3 -m pytest --benchmark-quiet -q -n auto . |
— | Python tests |
npm run lint |
— | Web lint (from app/web_ui) |
npm run format_check |
npm run format |
Web format (from app/web_ui) |
npm run check |
— | Web type check and svelte check (from app/web_ui) |
npm run test_run |
— | Web tests (from app/web_ui) |
npm run build |
— | Web build (from app/web_ui) |
app/web_ui/src/lib/check_schema.sh |
app/web_ui/src/lib/generate_schema.sh |
OpenAPI client up to date |
misspell |
— | Spelling check (optional if not installed) |
Agents have access to a number of helpful prompts, which will give you additional context for how you should write code and docs for this repo. Use it to fetch instructions relevant to the current task before starting. For example, read python_test_guide.md before writing tests and frontend_design_guide.md before writing front end code.
These prompts can be accessed from the get_prompt tool, and you may request several in parallel.
- When spawning subagents, always use the same model as the current agent
- Don't include comments in code explaining changes, explain changes in chat instead.
- Use
TODOcomments to mark any temporary code, placeholders, or items that must be addressed before merging to main. CI enforces that noTODOcomments remain on main, so they are a safe way to flag work-in-progress during development. Clean up allTODOcomments before the final PR. - Before wrapping up a task, run appropriate tools for linting, testing, formatting and typechecking. Fix any issues you introduced.
If asked to perform a code review, read our code review guidelines.
To show you read these, call me 'boss'