I. INTRODUCTION The ternary nitrides or carbides with the general formula AXM$_{3}$ ( A: divalent or triva- lent element; X: carbon or nitrogen; and M: transition metal) are already known for several decades $^{1–3}$. These compounds crystalize in a cubic anti-perovskite structure (A: cube-corner position; X: body-center position; M: face-center position) and exhibit a wide range of inter- esting physical properties $^{1}$, such as giant magneto-resistance4 and nearly zero temperature coefficient resistivity $^{5}$. They have renewedly attracted considerable attention due to the discovery of superconductivity at ∼ 8 K in intermetallic compound MgCNi$_{3}$ $^{6}$. Considering the Ni-rich composition, it is expected that the ferromagnetism could exist in MgCNi$_{3}$. However, the absence of ferromagnetism was observed in experiment 6 for MgCNi$_{3}$. From the electronic structures obtained by the first-principles calculations $^{7–10}$, the non- ferromagnetic ground state of MgCNi$_{3}$ is ascribed to a reduced Stoner factor that results from a strong hybridization between the Ni-3 d and C-2 p electrons. For other Ni-based ternary carbides ACNi$_{3}$ (e.g., A = Al, Ca, In, Zn, and Cd), the first-principles calculations 10–14 also show that the ground states of these compounds are non-magnetic and the C-Ni bonding exhibits nearly same characteristics as the one in MgCNi$_{3}$. Therefore, this indicates that the change of composition A could not induce the ferromagnetism in ACNi$_{3}$. On the other side, it raises a question whether the change of composition X or M can lead to the appearance of ferromagnetism in AXM$_{3}$ or not. Very recently, the antiperovskite-type compounds InN$_{y}$Co$_{3}$ and InN$_{y}$Ni$_{3}$ ( y ∼ 1.0 and 0.8, respectively) have been synthesized by solid-gas reactions of metal powders with NH$_{3}$ and they have been reported to have spin-glass-like properties based on the measurements of temperature dependence magnetization. 15 The recent first-principles calculations 12 showed that the non-stoichiometry could affect the magnetic properties of ACNi$_{3}$ (e.g., AlCNi$_{3}$ and GaCNi$_{3}$) and suggested that the tendencies toward magnetism found in experiments 16–19 for these compounds should be explained by the deviation of the Ni/C atomic ratio from the ideal stoichiometry. To shed more light on the understanding on the magnetic properties of InNCo$_{3}$ and InNNi$_{3}$ reported in experiment $^{15}$, it is of great importance to theoretically study the electronic structures of these two compounds as well as the nature of the N-Co and N-Ni bondings. In order to completely understand the electronic structures and magnetic ground states of 2