# Generate() without python for inference

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgenerate-without-python-for-inference%2F28465%3E%5C
**Category:** Intermediate\
**Created:** [December 26, 2022, 6:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgenerate-without-python-for-inference%2F28465 "2022-12-26T18:43:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohotmoz](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@mohotmoz](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmohotmoz)%5C
**Post date:** [December 26, 2022, 6:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgenerate-without-python-for-inference%2F28465%2F1 "2022-12-26T18:43:10Z")

</div>

Hello everyone,  
As always a huge thank you in advance to the HF team / community for such an amazing set of resources. I am looking at doing some inference in a relatively resource constrained environment. I am familiar with the various model optimizations out there (OpenVINO, ONNX runtimes, etc.) - a huge shout-out again to HF for some really great resources/tutorials there. I would like to be able to run beam search (or potentially multinomial sampling) - right now I am using the amazing `generate()` function and everything it provides. Since we can get the models “out of python” using ONNX/OpenVINO/etc. - was wondering if there are any best practices / documentation on getting the generate() function “out of python” as well? Looking at C and/or Rust for the current application.  
Thank you as always!!
