Pahl Digital Art
Kilchberg ZH · Switzerland
AI training & LLM optimisation in Kilchberg, Zurich
A language model should handle your task reliably, respond promptly and fit the intended device. Pahl Digital Art brings data preparation, LoRA fine-tuning and local LLM optimisation into the development of your application. Our practical experience comes from building Swiftli Smart HR on Apple Silicon.
Start a projectTurn a workflow into a testable AI function
We first establish the inputs, the required output and what counts as an error. A focused trial shows what a suitable base model already achieves. This defines the next steps for training, optimisation and integration. Explicit rules and human approval remain part of the workflow wherever the task requires them.
Data preparation and LoRA fine-tuning
Useful training examples reflect the actual task: common wording, languages, required output formats and difficult edge cases. We clean and structure this data, check conflicting answers and separate training, validation and test sets. Near-duplicate examples should not appear on both sides of a test.
LoRA trains additional adapters for an existing language model, adapting its behaviour to a defined task. The base model, training examples and settings are chosen around the intended result and available memory.
Evaluation: compare quality before and after training
We compare the base model and trained adapter on held-out examples. The measures that matter include correct results, valid structured outputs and dependable handling of incomplete or ambiguous inputs. Previously working cases are also checked again, so that gains on one task do not silently reduce performance elsewhere.
- Task-specific quality criteria and failure cases
- Separate checks by language and input type
- Comparison with the base model and previous adapter versions
Quantisation: use less memory for model weights
Model weights can be represented with fewer bits. This reduces their memory requirements and can make a model fit a smaller device. We test how the chosen quantisation affects output quality and speed in the actual application. Runtime memory and context must fit on the device alongside the weights.
KV cache: keep calculations during inference
As a transformer generates an answer step by step, it retains computed key and value states in a KV cache. Earlier tokens therefore do not need to be processed fully again for each new step. With long contexts, this cache can become a substantial part of memory use.
Suitable KV-cache quantisation can reduce the memory used by these states. It affects a different part of the system from quantising model weights. Model and runtime support, effects on quality and additional computational work are evaluated separately.
Prefix and prompt caching: reuse repeated input work
The same instructions or an unchanged document opening may appear in many requests. Prefix caching reuses their computed KV states. This reduces the work of processing the input, known as prefill, and can shorten the wait before output begins.
Reuse requires an exact token-prefix match with compatible model, adapter, tokenizer and cache configuration. Similar text is not enough. We measure cache hits and new inputs separately; the rate at which subsequent tokens are generated is a separate measure.
Response and result caching: reuse completed outputs
Some repeated tasks allow a checked result to be served directly from an application cache. A valid hit can then avoid the entire model call. This stores the completed answer or structured output, whereas prefix caching reuses internal computation states.
The cache must account for the input, context, data version and access rights. Changes to data, the model or rules invalidate affected results. Which outputs may be stored and for how long are decisions made as part of the application design.
Local integration with MLX on Apple Silicon
Training and inference are connected to application behaviour: loading models and adapters, checking outputs, cancelling long operations and handling errors clearly. We use MLX for local implementation on the Mac. Model versions, updates and memory limits are planned alongside the user experience.
In Swiftli Smart HR, our language adapters translate inputs into structured planning constraints. Our August 2026 development account explains the switch to a quantised model, the four language adapters and verification of the model supply chain. It also describes the state of the product and the work still open at that time.
Measure on the intended hardware
We assess quality and responsiveness together on the target device. Time to first token, or TTFT, describes a different stage from the decode rate for generating subsequent tokens. Time to a usable result and peak memory use also matter.
Comparisons document the model and adapter versions, quantisation, input lengths and cache states. A fresh start and a repeated request are measured separately. This shows which optimisation actually helps your task.
Common questions
Does every task need fine-tuning?
No. We first test a suitable base model with clear inputs and output rules. LoRA training is worthwhile when it can provide a verifiable improvement for the particular task.
What do you need for an initial trial?
A description of the workflow, representative inputs with expected outputs, and the intended languages and devices. We also establish permitted uses of the data and the errors the application needs to detect.
Does prefix caching make every answer faster?
It can avoid repeated prefill work for a matching input prefix. A new prefix does not have that benefit. Whether the whole request becomes faster also depends on output length, the model and the device.
Does local AI keep all data on the device?
Model computation can run locally. Whether all data stays local also depends on downloads, synchronisation, logging and connected services. These data paths are established for the entire application.