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-Small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use esilva/KapiCoder-Mongo-Small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="esilva/KapiCoder-Mongo-Small") 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-Small") model = AutoModelForCausalLM.from_pretrained("esilva/KapiCoder-Mongo-Small", 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-Small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "esilva/KapiCoder-Mongo-Small" # 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-Small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/esilva/KapiCoder-Mongo-Small
- SGLang
How to use esilva/KapiCoder-Mongo-Small 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-Small" \ --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-Small", "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-Small" \ --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-Small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use esilva/KapiCoder-Mongo-Small with Docker Model Runner:
docker model run hf.co/esilva/KapiCoder-Mongo-Small
Download provenance/upload_manifest.json from esilva/KapiCoder-Mongo-Small: direct link, hf CLI and curl.
- Browser
- Download file 2.58 kB
-
https://huggingface.co/esilva/KapiCoder-Mongo-Small/resolve/main/provenance/upload_manifest.json
- Command line
-
hf download hf://esilva/KapiCoder-Mongo-Small/provenance/upload_manifest.json
-
curl -L -o upload_manifest.json https://huggingface.co/esilva/KapiCoder-Mongo-Small/resolve/main/provenance/upload_manifest.json
2.58 kB
| { | |
| "schema": "kapi-hf-upload-manifest/2", | |
| "repo_id": "esilva/KapiCoder-Mongo-Small", | |
| "release_tag": "v0.1.0-preview", | |
| "tier": "small", | |
| "note": "sha256 de todos os arquivos do repositorio, exceto este (provenance/upload_manifest.json)", | |
| "files": [ | |
| { | |
| "path": "LICENSE", | |
| "bytes": 11343, | |
| "sha256": "832dd9e00a68dd83b3c3fb9f5588dad7dcf337a0db50f7d9483f310cd292e92e" | |
| }, | |
| { | |
| "path": "NOTICE.md", | |
| "bytes": 2143, | |
| "sha256": "ab15402e7d43109b5730516a0b7ccdeda57bf9c8256d92ae1e9c85a2d48765dd" | |
| }, | |
| { | |
| "path": "README.md", | |
| "bytes": 31233, | |
| "sha256": "6aca52aefaf95d76669f69aba4be5e8c261e542876b0da94b822a7d5daa21ca4" | |
| }, | |
| { | |
| "path": "REPLAY_ATTRIBUTION.md", | |
| "bytes": 47459, | |
| "sha256": "0f3f49f1ada3769a05f52c2dcde7de895a766f4605c1422557e963309376f9a6" | |
| }, | |
| { | |
| "path": "config.json", | |
| "bytes": 1375, | |
| "sha256": "9dd8637a8aaa2eb099a2fbfcc1f3a13c47055b870a850fe807a90f91470165ed" | |
| }, | |
| { | |
| "path": "evaluation/homologation_v1_summary.json", | |
| "bytes": 140916, | |
| "sha256": "a592b7eaeb830e67033e02008ebd272409254709b4617f9824504bc16bb85a54" | |
| }, | |
| { | |
| "path": "evaluation/val_v2c_summary.json", | |
| "bytes": 20575, | |
| "sha256": "df5aee38ddbc5f79ffb3faca3b601b74d85e8020ddfb336ab2aed1099cb075ea" | |
| }, | |
| { | |
| "path": "examples/example_fim.py", | |
| "bytes": 2643, | |
| "sha256": "004e8463eb540c954348407cd6190219e8508b1e53797f4973cab0c59af3b42e" | |
| }, | |
| { | |
| "path": "generation_config.json", | |
| "bytes": 117, | |
| "sha256": "444ea57ebf361c659d1f5c23508319b691e181d122588ea3cdd5f68d3e618b1f" | |
| }, | |
| { | |
| "path": "merges.txt", | |
| "bytes": 1671839, | |
| "sha256": "599bab54075088774b1733fde865d5bd747cbcc7a547c5bc12610e874e26f5e3" | |
| }, | |
| { | |
| "path": "model.safetensors", | |
| "bytes": 3087467144, | |
| "sha256": "93a774dbc3335d85fefc9c11cf595f2a89d80c11177d11f3c85674744ab48108" | |
| }, | |
| { | |
| "path": "provenance/model_lock.json", | |
| "bytes": 4182, | |
| "sha256": "0a0da0f412f1b44b118fa72b7001ae6de1464d402ed1eb39a7af5010f628b1fa" | |
| }, | |
| { | |
| "path": "tokenizer.json", | |
| "bytes": 7031645, | |
| "sha256": "c0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539" | |
| }, | |
| { | |
| "path": "tokenizer_config.json", | |
| "bytes": 7308, | |
| "sha256": "4a917e4772d9b246ef600e1c5d7d81e3a81ae9f3f2d10d78ccb02c86e5fb184a" | |
| }, | |
| { | |
| "path": "vocab.json", | |
| "bytes": 2776833, | |
| "sha256": "ca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910" | |
| } | |
| ] | |
| } | |