Text Generation
Transformers
Safetensors
English
asterisk
reasoning
implicit-reasoning
chain-of-thought
llama
aspp
pi-flow
deep-reasoning
conversational
custom_code
Run this model with HF Jobs
Run NoesisLab/Geilim-1B-Instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/NoesisLab/Geilim-1B-Instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/NoesisLab/Geilim-1B-Instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/NoesisLab/Geilim-1B-Instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/NoesisLab/Geilim-1B-Instruct. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use NoesisLab/Geilim-1B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NoesisLab/Geilim-1B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NoesisLab/Geilim-1B-Instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("NoesisLab/Geilim-1B-Instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NoesisLab/Geilim-1B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NoesisLab/Geilim-1B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NoesisLab/Geilim-1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NoesisLab/Geilim-1B-Instruct
- SGLang
How to use NoesisLab/Geilim-1B-Instruct 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 "NoesisLab/Geilim-1B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NoesisLab/Geilim-1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "NoesisLab/Geilim-1B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NoesisLab/Geilim-1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NoesisLab/Geilim-1B-Instruct with Docker Model Runner:
docker model run hf.co/NoesisLab/Geilim-1B-Instruct
Update handler.py
Browse files21 unmodified lines222324252627282930313233343536373839404142434441 unmodified lines868788899091928 unmodified lines10110210310410510610710810911011111211311411511611711811912012116 unmodified lines13813914014114214314414514614714814921 unmodified linesclass EndpointHandler:"""Hugging Face Inference Endpoints custom handler.Supports both text and chat formats:Text format:{"inputs": "Hello, how are you?"}Chat format (recommended):{"inputs": [{"role": "user", "content": "Hello!"}]}or{"inputs": {"messages": [{"role": "user", "content": "Hello!"}]}}Parameters:- max_new_tokens (default: 256): Max tokens to generate- temperature (default: 0.7): Sampling temperature- top_p (default: 0.95): Nucleus sampling- repetition_penalty (default: 1.0): Penalize repetitions- return_full_text (default: False): If True, return full conversation; if False, only new tokens"""def __init__(self, model_dir: str):41 unmodified linestop_p = float(params.get("top_p", 0.95))top_k = int(params.get("top_k", 0))repetition_penalty = float(params.get("repetition_penalty", 1.0))return_full_text = bool(params.get("return_full_text", False))do_sample = bool(params.get("do_sample", temperature > 0))num_beams = int(params.get("num_beams", 1))8 unmodified linesif _is_messages(item):# Chat template path exists in repo; tokenizer.apply_chat_template will use it if configuredtry:# Use tokenize=False to get the formatted string firstprompt = self.tokenizer.apply_chat_template(item,tokenize=False,add_generation_prompt=True,)# Then tokenize it separately to avoid unpacking issuesenc = self.tokenizer(prompt, return_tensors="pt")input_ids = enc["input_ids"]except Exception:# Fallback: if chat template fails, use the last user messagelast_user_msg = next((m["content"] for m in reversed(item) if m.get("role") == "user"), "")enc = self.tokenizer(last_user_msg, return_tensors="pt")input_ids = enc["input_ids"]else:if not isinstance(item, str):item = str(item)16 unmodified lineseos_token_id=self.tokenizer.eos_token_id,)# Return newly generated tokens by default, or full text if requestedif return_full_text:text = self.tokenizer.decode(gen_ids[0], skip_special_tokens=True)else:new_tokens = gen_ids[0, input_len:]text = self.tokenizer.decode(new_tokens, skip_special_tokens=True)return {"generated_text": text}# Batch support21 unmodified lines2223242526272829303141 unmodified lines7374757677788 unmodified lines878889909192939495969716 unmodified lines11411511611711811912012112221 unmodified linesclass EndpointHandler:"""Hugging Face Inference Endpoints custom handler.Expects:- request body is a dict- always contains `inputs`- may contain `parameters` for generation"""def __init__(self, model_dir: str):41 unmodified linestop_p = float(params.get("top_p", 0.95))top_k = int(params.get("top_k", 0))repetition_penalty = float(params.get("repetition_penalty", 1.0))do_sample = bool(params.get("do_sample", temperature > 0))num_beams = int(params.get("num_beams", 1))8 unmodified linesif _is_messages(item):# Chat template path exists in repo; tokenizer.apply_chat_template will use it if configuredinput_ids = self.tokenizer.apply_chat_template(item,return_tensors="pt",add_generation_prompt=True,)else:if not isinstance(item, str):item = str(item)16 unmodified lineseos_token_id=self.tokenizer.eos_token_id,)# Only return newly generated tokensnew_tokens = gen_ids[0, input_len:]text = self.tokenizer.decode(new_tokens, skip_special_tokens=True)return {"generated_text": text}# Batch support
handler.py+12-39