  We consider the cotangent bundle $T^*F_\lambda$ of a $GL_n$ partial flag
variety, $\lambda=(\lambda_1,...,\lambda_N)$, $|\lambda|=\sum_i\lambda_i=n$,
and the torus $T=(\C^\times)^{n+1}$ equivariant K-theory algebra
$K_T(T^*F_\lambda)$. We introduce K-theoretic stable envelope maps
$\Stab_{\sigma}: \oplus_{|\lambda|=n}
K_T((T^*F_\lambda)^T)\to\oplus_{|\lambda|=n}K_T(T^*F_\lambda)$, where
$\sigma\in S_n$. Using these maps we define a quantum loop algebra action on
$\oplus_{|\lambda|=n}K_T(T^*F_\lambda)$. We describe the associated Bethe
algebra $B^q(K_T(T^*F_\lambda))$ by generators and relations in terms of a
discrete Wronski map. We prove that the limiting Bethe algebra
$B^q(K_T(T^*F_\lambda))$, called the Gelfand-Zetlin algebra, coincides with the
algebra of multiplication operators of the algebra $K_T(T^*F_\lambda)$. We
conjecture that the Bethe algebra $B^q(K_T(T^*F_\lambda))$ coincides with the
algebra of quantum multiplication on $K_T(T^*F_\lambda)$ introduced by Givental
and Lee.
  The stable envelope maps are defined with the help of Newton polygons of
Laurent polynomials representing elements of $K_T(T^*F_\lambda)$ and with the
help of the trigonometric weight functions introduced in [TV1, TV3] to
construct q-hypergeometric solutions of trigonometric qKZ equations.
  The paper has five appendices. In particular, in Appendix 5 we describe the
Bethe algebra of the XXZ model by generators and relations.
