Instructions to use lmstudio-community/gemma-3-1b-it-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use lmstudio-community/gemma-3-1b-it-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="lmstudio-community/gemma-3-1b-it-GGUF", filename="gemma-3-1b-it-Q3_K_L.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use lmstudio-community/gemma-3-1b-it-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
Use Docker
docker model run hf.co/lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use lmstudio-community/gemma-3-1b-it-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lmstudio-community/gemma-3-1b-it-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmstudio-community/gemma-3-1b-it-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
- Ollama
How to use lmstudio-community/gemma-3-1b-it-GGUF with Ollama:
ollama run hf.co/lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
- Unsloth Studio
How to use lmstudio-community/gemma-3-1b-it-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for lmstudio-community/gemma-3-1b-it-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for lmstudio-community/gemma-3-1b-it-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for lmstudio-community/gemma-3-1b-it-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use lmstudio-community/gemma-3-1b-it-GGUF with Docker Model Runner:
docker model run hf.co/lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
- Lemonade
How to use lmstudio-community/gemma-3-1b-it-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull lmstudio-community/gemma-3-1b-it-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.gemma-3-1b-it-GGUF-Q4_K_M
List all available models
lemonade list
1B-IT Model | Prone to hallucinations?
I think I've figured out the main issue: runtime Vulkan llama.cpp v1.21.0.
I switched over to CPU only engine and it's working without issue, albeit inference is slower.
I'm going to attempt another run with a previous Vulkan runtime engine and see if there are any differences, will provide notes here.
Thanks for the report! I've escalated it :)
@AEsau interesting. Thanks for reporting. Would you be able to share the copy-and-pasted results of right-clicking the gear icon next to the model so that we can see what config you're using when you see this issue?
Here you go @mattjcly :
appVersion: 0.3.13
appBuildVersion: "1"
modelPath: lmstudio-community/gemma-3-1b-it-GGUF/gemma-3-1b-it-Q4_K_M.gguf
prediction:
layers:
- layerName: hardware
config:
fields: []
- layerName: modelDefault
config:
fields:
- key: llm.prediction.promptTemplate
value: <Default prompt template omitted for brevity>
- key: llm.prediction.llama.cpuThreads
value: 4
- layerName: userModelDefault
config:
fields:
- key: llm.prediction.promptTemplate
value:
type: jinja
jinjaPromptTemplate:
template: >
{{ bos_token }}
{%- if messages[0]['role'] == 'system' -%}
{%- if messages[0]['content'] is string -%}
{%- set first_user_prefix = messages[0]['content'] + '
' -%}
{%- else -%}
{%- set first_user_prefix = messages[0]['content'][0]['text'] + '
' -%}
{%- endif -%}
{%- set loop_messages = messages[1:] -%}
{%- else -%}
{%- set first_user_prefix = "" -%}
{%- set loop_messages = messages -%}
{%- endif -%}
{%- for message in loop_messages -%}
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
{%- endif -%}
{%- if (message['role'] == 'assistant') -%}
{%- set role = "model" -%}
{%- else -%}
{%- set role = message['role'] -%}
{%- endif -%}
{{ '<start_of_turn>' + role + '
' + (first_user_prefix if loop.first else "") }}
{%- if message['content'] is string -%}
{{ message['content'] | trim }}
{%- elif message['content'] is iterable -%}
{%- for item in message['content'] -%}
{%- if item['type'] == 'image' -%}
{{ '<start_of_image>' }}
{%- elif item['type'] == 'text' -%}
{{ item['text'] | trim }}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{{ raise_exception("Invalid content type") }}
{%- endif -%}
{{ '<end_of_turn>
' }}
{%- endfor -%}
{%- if add_generation_prompt -%}
{{'<start_of_turn>model
'}}
{%- endif -%}
bosToken: <bos>
eosToken: <eos>
inputConfig:
messagesConfig:
contentConfig:
type: array
textFieldName: text
useTools: false
stopStrings: []
- key: llm.prediction.maxPredictedTokens
value:
checked: false
value: 2048
- layerName: instance
config:
fields: []
- layerName: conversationSpecific
config:
fields:
- key: llm.prediction.llama.cpuThreads
value: 6
- key: llm.prediction.temperature
value: 0.5
load:
layers:
- layerName: currentlyLoaded
config:
fields:
- key: llm.load.llama.cpuThreadPoolSize
value: 6
- key: llm.load.contextLength
value: 4096
- key: llm.load.llama.acceleration.offloadRatio
value: 1
- layerName: instance
config:
fields: []
hardware:
gpuSurveyResult:
result:
code: Success
message: ""
gpuInfo:
- name: Radeon RX 5500 XT
deviceId: 0
totalMemoryCapacityBytes: 42893049856
dedicatedMemoryCapacityBytes: 8573157376
integrationType: Discrete
detectionPlatform: Vulkan
detectionPlatformVersion: 1.3.283
otherInfo: {}
cpuSurveyResult:
result:
code: Success
message: ""
cpuInfo:
name: ""
architecture: x86_64
supportedInstructionSetExtensions:
- AVX
- AVX2
selectedRuntimes:
- modelCompatibilityType: gguf
runtime:
name: llama.cpp-win-x86_64-vulkan-avx2
version: 1.21.0


