Text Generation
Transformers
Safetensors
English
Portuguese
qwen2
mongodb
code
fim
autocomplete
synthetic-data
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use esilva/KapiCoder-Mongo-Nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use esilva/KapiCoder-Mongo-Nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="esilva/KapiCoder-Mongo-Nano") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("esilva/KapiCoder-Mongo-Nano") model = AutoModelForCausalLM.from_pretrained("esilva/KapiCoder-Mongo-Nano", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use esilva/KapiCoder-Mongo-Nano with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "esilva/KapiCoder-Mongo-Nano" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "esilva/KapiCoder-Mongo-Nano", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/esilva/KapiCoder-Mongo-Nano
- SGLang
How to use esilva/KapiCoder-Mongo-Nano 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 "esilva/KapiCoder-Mongo-Nano" \ --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": "esilva/KapiCoder-Mongo-Nano", "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 "esilva/KapiCoder-Mongo-Nano" \ --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": "esilva/KapiCoder-Mongo-Nano", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use esilva/KapiCoder-Mongo-Nano with Docker Model Runner:
docker model run hf.co/esilva/KapiCoder-Mongo-Nano
Download evaluation/cursor_in_call_summary.json from esilva/KapiCoder-Mongo-Nano: direct link, hf CLI and curl.
- Browser
- Download file 13.1 kB
-
https://huggingface.co/esilva/KapiCoder-Mongo-Nano/resolve/main/evaluation/cursor_in_call_summary.json
- Command line
-
hf download hf://esilva/KapiCoder-Mongo-Nano/evaluation/cursor_in_call_summary.json
-
curl -L -o cursor_in_call_summary.json https://huggingface.co/esilva/KapiCoder-Mongo-Nano/resolve/main/evaluation/cursor_in_call_summary.json
13.1 kB
| { | |
| "schema": "kapi-hf-eval-summary/1", | |
| "kind": "cursor_in_call_v1", | |
| "label": "Internal evaluation on synthetic data; no blind human-written set. Aggregates only; no item text.", | |
| "model": "esilva/KapiCoder-Mongo-Nano", | |
| "suite_sha256_prefix": "e7b40a166c74", | |
| "decoding": "greedy", | |
| "limit_tokens": 64, | |
| "runs": { | |
| "t0_v3_ctxv2": { | |
| "context_tokens": 2048, | |
| "items": 1200, | |
| "postprocess": "v2-close-inner", | |
| "overall_at_64": { | |
| "n": 1200, | |
| "match": 0.05, | |
| "suffix_consistent": 0.8392, | |
| "balanced": 0.9042, | |
| "op_valid": 0.8108, | |
| "op_valid_n": 1200, | |
| "field_grounded": 0.791, | |
| "field_grounded_n": 775, | |
| "empty": 0.0 | |
| }, | |
| "by_cut_kind_at_64": { | |
| "after_colon": { | |
| "n": 150, | |
| "match": 0.1533, | |
| "suffix_consistent": 0.9733, | |
| "balanced": 0.9867, | |
| "op_valid": 0.9467, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.6579, | |
| "field_grounded_n": 38, | |
| "empty": 0.0 | |
| }, | |
| "after_comma": { | |
| "n": 150, | |
| "match": 0.0, | |
| "suffix_consistent": 0.96, | |
| "balanced": 0.9733, | |
| "op_valid": 0.96, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8667, | |
| "field_grounded_n": 150, | |
| "empty": 0.0 | |
| }, | |
| "after_dollar": { | |
| "n": 150, | |
| "match": 0.0067, | |
| "suffix_consistent": 0.8067, | |
| "balanced": 0.9333, | |
| "op_valid": 0.8067, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.6935, | |
| "field_grounded_n": 62, | |
| "empty": 0.0 | |
| }, | |
| "after_open": { | |
| "n": 150, | |
| "match": 0.02, | |
| "suffix_consistent": 0.9733, | |
| "balanced": 0.98, | |
| "op_valid": 0.9, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8357, | |
| "field_grounded_n": 140, | |
| "empty": 0.0 | |
| }, | |
| "dotted_path": { | |
| "n": 150, | |
| "match": 0.02, | |
| "suffix_consistent": 0.9667, | |
| "balanced": 0.9667, | |
| "op_valid": 0.96, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8867, | |
| "field_grounded_n": 150, | |
| "empty": 0.0 | |
| }, | |
| "in_string": { | |
| "n": 150, | |
| "match": 0.0, | |
| "suffix_consistent": 0.2, | |
| "balanced": 0.46, | |
| "op_valid": 0.2, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.6087, | |
| "field_grounded_n": 23, | |
| "empty": 0.0 | |
| }, | |
| "partial_ident": { | |
| "n": 150, | |
| "match": 0.0933, | |
| "suffix_consistent": 0.9933, | |
| "balanced": 0.9933, | |
| "op_valid": 0.94, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.6867, | |
| "field_grounded_n": 150, | |
| "empty": 0.0 | |
| }, | |
| "partial_op": { | |
| "n": 150, | |
| "match": 0.1067, | |
| "suffix_consistent": 0.84, | |
| "balanced": 0.94, | |
| "op_valid": 0.7733, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.7742, | |
| "field_grounded_n": 62, | |
| "empty": 0.0 | |
| } | |
| }, | |
| "by_context_kind_at_64": { | |
| "full": { | |
| "n": 736, | |
| "match": 0.0611, | |
| "suffix_consistent": 0.8247, | |
| "balanced": 0.8886, | |
| "op_valid": 0.7921, | |
| "op_valid_n": 736, | |
| "field_grounded": 0.9325, | |
| "field_grounded_n": 474, | |
| "empty": 0.0 | |
| }, | |
| "irrelevant": { | |
| "n": 244, | |
| "match": 0.041, | |
| "suffix_consistent": 0.8361, | |
| "balanced": 0.9262, | |
| "op_valid": 0.8074, | |
| "op_valid_n": 244, | |
| "field_grounded": 0.6792, | |
| "field_grounded_n": 159, | |
| "empty": 0.0 | |
| }, | |
| "none": { | |
| "n": 220, | |
| "match": 0.0227, | |
| "suffix_consistent": 0.8909, | |
| "balanced": 0.9318, | |
| "op_valid": 0.8773, | |
| "op_valid_n": 220, | |
| "field_grounded": 0.4437, | |
| "field_grounded_n": 142, | |
| "empty": 0.0 | |
| } | |
| }, | |
| "by_target_distance_at_64": {} | |
| }, | |
| "t0_v4b_ctxv2": { | |
| "context_tokens": 2048, | |
| "items": 1200, | |
| "postprocess": "v2-close-inner", | |
| "overall_at_64": { | |
| "n": 1200, | |
| "match": 0.0775, | |
| "suffix_consistent": 0.9508, | |
| "balanced": 0.9783, | |
| "op_valid": 0.945, | |
| "op_valid_n": 1200, | |
| "field_grounded": 0.8427, | |
| "field_grounded_n": 769, | |
| "empty": 0.0 | |
| }, | |
| "by_cut_kind_at_64": { | |
| "after_colon": { | |
| "n": 150, | |
| "match": 0.16, | |
| "suffix_consistent": 1.0, | |
| "balanced": 1.0, | |
| "op_valid": 1.0, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8158, | |
| "field_grounded_n": 38, | |
| "empty": 0.0 | |
| }, | |
| "after_comma": { | |
| "n": 150, | |
| "match": 0.0133, | |
| "suffix_consistent": 1.0, | |
| "balanced": 1.0, | |
| "op_valid": 1.0, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8533, | |
| "field_grounded_n": 150, | |
| "empty": 0.0 | |
| }, | |
| "after_dollar": { | |
| "n": 150, | |
| "match": 0.0, | |
| "suffix_consistent": 0.7933, | |
| "balanced": 0.9133, | |
| "op_valid": 0.7933, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8438, | |
| "field_grounded_n": 64, | |
| "empty": 0.0 | |
| }, | |
| "after_open": { | |
| "n": 150, | |
| "match": 0.0467, | |
| "suffix_consistent": 0.9867, | |
| "balanced": 0.9867, | |
| "op_valid": 0.9867, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8714, | |
| "field_grounded_n": 140, | |
| "empty": 0.0 | |
| }, | |
| "dotted_path": { | |
| "n": 150, | |
| "match": 0.02, | |
| "suffix_consistent": 0.9867, | |
| "balanced": 0.9867, | |
| "op_valid": 0.9867, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8733, | |
| "field_grounded_n": 150, | |
| "empty": 0.0 | |
| }, | |
| "in_string": { | |
| "n": 150, | |
| "match": 0.1533, | |
| "suffix_consistent": 0.98, | |
| "balanced": 0.9867, | |
| "op_valid": 0.98, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8333, | |
| "field_grounded_n": 12, | |
| "empty": 0.0 | |
| }, | |
| "partial_ident": { | |
| "n": 150, | |
| "match": 0.0933, | |
| "suffix_consistent": 1.0, | |
| "balanced": 1.0, | |
| "op_valid": 0.9533, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.7667, | |
| "field_grounded_n": 150, | |
| "empty": 0.0 | |
| }, | |
| "partial_op": { | |
| "n": 150, | |
| "match": 0.1333, | |
| "suffix_consistent": 0.86, | |
| "balanced": 0.9533, | |
| "op_valid": 0.86, | |
| "op_valid_n": 150, | |
| "field_grounded": 0.8769, | |
| "field_grounded_n": 65, | |
| "empty": 0.0 | |
| } | |
| }, | |
| "by_context_kind_at_64": { | |
| "full": { | |
| "n": 736, | |
| "match": 0.0897, | |
| "suffix_consistent": 0.9429, | |
| "balanced": 0.9755, | |
| "op_valid": 0.9375, | |
| "op_valid_n": 736, | |
| "field_grounded": 0.9456, | |
| "field_grounded_n": 478, | |
| "empty": 0.0 | |
| }, | |
| "irrelevant": { | |
| "n": 244, | |
| "match": 0.0656, | |
| "suffix_consistent": 0.9508, | |
| "balanced": 0.9795, | |
| "op_valid": 0.9385, | |
| "op_valid_n": 244, | |
| "field_grounded": 0.8861, | |
| "field_grounded_n": 158, | |
| "empty": 0.0 | |
| }, | |
| "none": { | |
| "n": 220, | |
| "match": 0.05, | |
| "suffix_consistent": 0.9773, | |
| "balanced": 0.9864, | |
| "op_valid": 0.9773, | |
| "op_valid_n": 220, | |
| "field_grounded": 0.4211, | |
| "field_grounded_n": 133, | |
| "empty": 0.0 | |
| } | |
| }, | |
| "by_target_distance_at_64": {} | |
| }, | |
| "t0_v4b_8k": { | |
| "context_tokens": 8192, | |
| "items": 1320, | |
| "postprocess": "v2-close-inner", | |
| "overall_at_64": { | |
| "n": 1320, | |
| "match": 0.0833, | |
| "suffix_consistent": 0.95, | |
| "balanced": 0.9795, | |
| "op_valid": 0.9439, | |
| "op_valid_n": 1320, | |
| "field_grounded": 0.8512, | |
| "field_grounded_n": 840, | |
| "empty": 0.0 | |
| }, | |
| "by_cut_kind_at_64": { | |
| "after_colon": { | |
| "n": 162, | |
| "match": 0.1852, | |
| "suffix_consistent": 1.0, | |
| "balanced": 1.0, | |
| "op_valid": 1.0, | |
| "op_valid_n": 162, | |
| "field_grounded": 0.8205, | |
| "field_grounded_n": 39, | |
| "empty": 0.0 | |
| }, | |
| "after_comma": { | |
| "n": 168, | |
| "match": 0.0119, | |
| "suffix_consistent": 1.0, | |
| "balanced": 1.0, | |
| "op_valid": 1.0, | |
| "op_valid_n": 168, | |
| "field_grounded": 0.869, | |
| "field_grounded_n": 168, | |
| "empty": 0.0 | |
| }, | |
| "after_dollar": { | |
| "n": 163, | |
| "match": 0.0, | |
| "suffix_consistent": 0.7914, | |
| "balanced": 0.9141, | |
| "op_valid": 0.7914, | |
| "op_valid_n": 163, | |
| "field_grounded": 0.8406, | |
| "field_grounded_n": 69, | |
| "empty": 0.0 | |
| }, | |
| "after_open": { | |
| "n": 165, | |
| "match": 0.0424, | |
| "suffix_consistent": 0.9879, | |
| "balanced": 0.9879, | |
| "op_valid": 0.9879, | |
| "op_valid_n": 165, | |
| "field_grounded": 0.8831, | |
| "field_grounded_n": 154, | |
| "empty": 0.0 | |
| }, | |
| "dotted_path": { | |
| "n": 159, | |
| "match": 0.0189, | |
| "suffix_consistent": 0.9874, | |
| "balanced": 0.9874, | |
| "op_valid": 0.9874, | |
| "op_valid_n": 159, | |
| "field_grounded": 0.8805, | |
| "field_grounded_n": 159, | |
| "empty": 0.0 | |
| }, | |
| "in_string": { | |
| "n": 168, | |
| "match": 0.1607, | |
| "suffix_consistent": 0.9821, | |
| "balanced": 0.9881, | |
| "op_valid": 0.9821, | |
| "op_valid_n": 168, | |
| "field_grounded": 0.8333, | |
| "field_grounded_n": 12, | |
| "empty": 0.0 | |
| }, | |
| "partial_ident": { | |
| "n": 169, | |
| "match": 0.1006, | |
| "suffix_consistent": 0.9941, | |
| "balanced": 1.0, | |
| "op_valid": 0.9467, | |
| "op_valid_n": 169, | |
| "field_grounded": 0.7751, | |
| "field_grounded_n": 169, | |
| "empty": 0.0 | |
| }, | |
| "partial_op": { | |
| "n": 166, | |
| "match": 0.1446, | |
| "suffix_consistent": 0.8554, | |
| "balanced": 0.9578, | |
| "op_valid": 0.8554, | |
| "op_valid_n": 166, | |
| "field_grounded": 0.8857, | |
| "field_grounded_n": 70, | |
| "empty": 0.0 | |
| } | |
| }, | |
| "by_context_kind_at_64": { | |
| "full": { | |
| "n": 736, | |
| "match": 0.0897, | |
| "suffix_consistent": 0.9429, | |
| "balanced": 0.9755, | |
| "op_valid": 0.9375, | |
| "op_valid_n": 736, | |
| "field_grounded": 0.9456, | |
| "field_grounded_n": 478, | |
| "empty": 0.0 | |
| }, | |
| "irrelevant": { | |
| "n": 244, | |
| "match": 0.0656, | |
| "suffix_consistent": 0.9508, | |
| "balanced": 0.9795, | |
| "op_valid": 0.9385, | |
| "op_valid_n": 244, | |
| "field_grounded": 0.8861, | |
| "field_grounded_n": 158, | |
| "empty": 0.0 | |
| }, | |
| "long": { | |
| "n": 120, | |
| "match": 0.1417, | |
| "suffix_consistent": 0.9417, | |
| "balanced": 0.9917, | |
| "op_valid": 0.9333, | |
| "op_valid_n": 120, | |
| "field_grounded": 0.9437, | |
| "field_grounded_n": 71, | |
| "empty": 0.0 | |
| }, | |
| "none": { | |
| "n": 220, | |
| "match": 0.05, | |
| "suffix_consistent": 0.9773, | |
| "balanced": 0.9864, | |
| "op_valid": 0.9773, | |
| "op_valid_n": 220, | |
| "field_grounded": 0.4211, | |
| "field_grounded_n": 133, | |
| "empty": 0.0 | |
| } | |
| }, | |
| "by_target_distance_at_64": { | |
| "2048": { | |
| "n": 60, | |
| "match": 0.1333, | |
| "suffix_consistent": 0.9667, | |
| "balanced": 1.0, | |
| "op_valid": 0.9667, | |
| "op_valid_n": 60, | |
| "field_grounded": 0.973, | |
| "field_grounded_n": 37, | |
| "empty": 0.0 | |
| }, | |
| "6144": { | |
| "n": 60, | |
| "match": 0.15, | |
| "suffix_consistent": 0.9167, | |
| "balanced": 0.9833, | |
| "op_valid": 0.9, | |
| "op_valid_n": 60, | |
| "field_grounded": 0.9118, | |
| "field_grounded_n": 34, | |
| "empty": 0.0 | |
| } | |
| } | |
| } | |
| }, | |
| "definitions": { | |
| "suffix_consistent": "prefix + suggestion + suffix parses (no duplicated or missing closer)", | |
| "op_valid": "the document parses and every operator is legal where it is", | |
| "field_grounded": "every field the suggestion cites exists in the target collection schema", | |
| "postprocess": "editor-context-v2 output rule: missing inner closers are appended when the suffix only closes the outer ones" | |
| } | |
| } | |