Instructions to use EleutherAI/llemma_34b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EleutherAI/llemma_34b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EleutherAI/llemma_34b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EleutherAI/llemma_34b") model = AutoModelForCausalLM.from_pretrained("EleutherAI/llemma_34b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EleutherAI/llemma_34b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EleutherAI/llemma_34b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/llemma_34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EleutherAI/llemma_34b
- SGLang
How to use EleutherAI/llemma_34b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "EleutherAI/llemma_34b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/llemma_34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "EleutherAI/llemma_34b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/llemma_34b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EleutherAI/llemma_34b with Docker Model Runner:
docker model run hf.co/EleutherAI/llemma_34b
Very cool model! I was able to reproduce the results from your paper using Oobabooga's textgen-webui
Here is a summary of what I did and some screenshots:
https://www.reddit.com/r/Oobabooga/comments/17k7eqf/llemma_34b_math_model_in_oobabooga/
I just wanted to drop a thank you and let you know that others were able to reproduce your results.
Have you tested it out with LaTex formatted equations?
Sort of , I was using an OCR to LaTeX program but it had a lot of extra syntax for formatting and I think that was throwing the model off. I had another AI simplify the LaTeX (I am currently very poor in LaTeX) and my instructions to the AI were not so great so it outputted a quasi-LaTeX output, was not properly formatted for rendering. The llemma model seemed to have figured it out though, and gave me a properly formatted LaTeX output. I'm going to do more testing today, but I think the best way to send equations to the model is via simple LaTeX formatting, avoiding stuff like specific fonts or other extra formatting LaTeX code.