Semiconductor alloys, for example group III metal nitrides and phosphides, such as AxB1-xN or ANxP1−x (where A,B metal atoms: Al, In, Ga) have been materials of interest for optoelectronic applications (light emitting diodes, lasers, detectors) for more then two decades. The potential possibility of tuning (via variation of the composition) of the band-gap and the lattice constant make them particularly attractive. The idea of tuning the band-gap (from infrared to ultraviolet), although simple in principle, requires solving a variety of practical problems, like lattice constants misfit of parent compounds, associated with atom sizes, thermodynamically determined phase segregation, system stability, band-gap bowing, efficiency of radiative transitions etc. The ab initio modeling is of particular importance in the field, since it allows to predict in a purely theoretical way the physical limits for various properties. It also provides a hint in which direction, technologically and experimentally, to proceed. We present the basic ideas behind the ab initio modeling and, as an example, the calculation results of structural, elastic and the electronic properties of chosen alloys are presented.