Background: Although liver function tests (LFTs) are routinely measured in primary care, raised levels in patients with no obvious liver disease may trigger a range of subsequent expensive and unnecessary management plans. The aim of this study was to develop and validate a prediction model to guide decision-making by general practitioners, which estimates risk of one year all-cause mortality in patients with no obvious liver disease. Methods: In this population-based historical cohort study, biochemistry data from patients in Tayside, Scotland, with LFTs performed in primary care were record-linked to secondary care and prescription databases to ascertain baseline characteristics, and to mortality data. Using this derivation cohort a survival model was developed to predict mortality. The model was assessed for calibration, discrimination (using the C-statistic) and performance, and validated using a separate cohort of Scottish primary care practices. Results: From the derivation cohort (n = 95 977), 2.7% died within one year. Predictors of mortality included: age; male gender; social deprivation; history of cancer, renal disease, stroke, ischaemic heart disease or respiratory disease; statin use; and LFTs (albumin, transaminase, alkaline phosphatase, bilirubin, and gamma-glutamyltransferase). The C-statistic for the final model was 0.82 (95% CI 0.80-0.84), and was similar in the validation cohort (n = 11 653) 0.86 (0.79-0.90). As an example of performance, for a 10% predicted probability cut-off, sensitivity = 52.8%, specificity = 94.0%, PPV = 21.0%, NPV = 98.5%. For the model without LFTs the respective values were 43.8%, 92.8%, 15.6%, 98.1%. Conclusions: The Algorithm for Liver Function Investigations (ALFI) is the first model to successfully estimate the probability of all-cause mortality in patients with no apparent liver disease having LFTs in primary care. While LFTs added to the model's discrimination and sensitivity, the clinical utility of ALFI remains to be established since LFTs did not improve an already high NPV for short term mortality and only modestly improved a very low PPV.