Immune defence is hypothesized to be a trait that bears significant fitness costs as well as benefits in that mounting a defence depreciates the value of other life-history traits. Thus the cost of mounting an immune response could affect the evolution of both the immune system and correlated life history traits. In this study we examined, by means of a diallel cross of four inbred lines, the genetic basis of two measures of immune function, metabolic rate and several traits in the sand cricket, Gryllus firmus. We specifically addressed the following questions: (1) is immune function determined primarily by genetic constitution or correlations with phenotypic traits that could reduce the effectiveness of the immune response; (2) do the two measures of immune function covary; (3) What are the contributions of additive, nonadditive and maternal effects to the immune function? As estimates of immune function, we used lytic activity and encapsulation rate. We found that inbred crickets were smaller than individuals from the crossed lines and took longer to develop. However, inbred lines did not differ from the crossed lines in immune function nor metabolic rates, suggesting that increased homozygosity has little or no effect on these traits in G. firmus. We found that both immune parameters showed significant genetic variation but no consistent relationships with the other phenotypic traits (metabolic rate, head width, body mass, development time and activity). There was significant additive genetic variation only in encapsulation rate, but, with the exception of the activity measure, significant nonadditive and reciprocal variances were found in all traits. Metabolic rate of crickets was heritable, but there was neither phenotypic nor genetic association between metabolic rate and the two parameters of immune function. Further, there was no correlation between these two measures. Females showed a higher encapsulation response than males, but there was no sex differences in lytic activity. Our study indicates that genetic variation in immune parameters can be a very significant contributor to phenotypic variation in immune function.