Instructions to use P0u4a/maincoder-1b-toolcalling-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use P0u4a/maincoder-1b-toolcalling-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Maincode/Maincoder-1B") model = PeftModel.from_pretrained(base_model, "P0u4a/maincoder-1b-toolcalling-lora") - Transformers
How to use P0u4a/maincoder-1b-toolcalling-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="P0u4a/maincoder-1b-toolcalling-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("P0u4a/maincoder-1b-toolcalling-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use P0u4a/maincoder-1b-toolcalling-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "P0u4a/maincoder-1b-toolcalling-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "P0u4a/maincoder-1b-toolcalling-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/P0u4a/maincoder-1b-toolcalling-lora
- SGLang
How to use P0u4a/maincoder-1b-toolcalling-lora 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 "P0u4a/maincoder-1b-toolcalling-lora" \ --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": "P0u4a/maincoder-1b-toolcalling-lora", "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 "P0u4a/maincoder-1b-toolcalling-lora" \ --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": "P0u4a/maincoder-1b-toolcalling-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use P0u4a/maincoder-1b-toolcalling-lora with Docker Model Runner:
docker model run hf.co/P0u4a/maincoder-1b-toolcalling-lora
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.4444444444444444, | |
| "eval_steps": 50, | |
| "global_step": 200, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.022222222222222223, | |
| "grad_norm": 0.6193130612373352, | |
| "learning_rate": 9.910000000000001e-05, | |
| "loss": 1.654, | |
| "mean_token_accuracy": 0.6766653224825859, | |
| "num_tokens": 23330.0, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.044444444444444446, | |
| "grad_norm": 0.5931444764137268, | |
| "learning_rate": 9.81e-05, | |
| "loss": 1.0695, | |
| "mean_token_accuracy": 0.7898772016167641, | |
| "num_tokens": 46070.0, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.06666666666666667, | |
| "grad_norm": 0.3904027044773102, | |
| "learning_rate": 9.71e-05, | |
| "loss": 0.7556, | |
| "mean_token_accuracy": 0.8578989505767822, | |
| "num_tokens": 68719.0, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.08888888888888889, | |
| "grad_norm": 0.32560470700263977, | |
| "learning_rate": 9.61e-05, | |
| "loss": 0.6186, | |
| "mean_token_accuracy": 0.8813577085733414, | |
| "num_tokens": 92126.0, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.1111111111111111, | |
| "grad_norm": 0.30384671688079834, | |
| "learning_rate": 9.51e-05, | |
| "loss": 0.5761, | |
| "mean_token_accuracy": 0.8921546742320061, | |
| "num_tokens": 114738.0, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.1111111111111111, | |
| "eval_loss": 0.5330827236175537, | |
| "eval_mean_token_accuracy": 0.9009262701869011, | |
| "eval_num_tokens": 114738.0, | |
| "eval_runtime": 40.5094, | |
| "eval_samples_per_second": 4.937, | |
| "eval_steps_per_second": 4.937, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.13333333333333333, | |
| "grad_norm": 0.40981799364089966, | |
| "learning_rate": 9.41e-05, | |
| "loss": 0.4978, | |
| "mean_token_accuracy": 0.9065196111798286, | |
| "num_tokens": 136310.0, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.15555555555555556, | |
| "grad_norm": 0.5167299509048462, | |
| "learning_rate": 9.310000000000001e-05, | |
| "loss": 0.4466, | |
| "mean_token_accuracy": 0.9203566908836365, | |
| "num_tokens": 158193.0, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.17777777777777778, | |
| "grad_norm": 0.5062010884284973, | |
| "learning_rate": 9.21e-05, | |
| "loss": 0.4003, | |
| "mean_token_accuracy": 0.9284946233034134, | |
| "num_tokens": 180767.0, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.2, | |
| "grad_norm": 0.38172802329063416, | |
| "learning_rate": 9.11e-05, | |
| "loss": 0.3457, | |
| "mean_token_accuracy": 0.9404646947979927, | |
| "num_tokens": 203203.0, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.2222222222222222, | |
| "grad_norm": 0.4985530376434326, | |
| "learning_rate": 9.010000000000001e-05, | |
| "loss": 0.3271, | |
| "mean_token_accuracy": 0.9434564337134361, | |
| "num_tokens": 226070.0, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.2222222222222222, | |
| "eval_loss": 0.3216829001903534, | |
| "eval_mean_token_accuracy": 0.9481457704305649, | |
| "eval_num_tokens": 226070.0, | |
| "eval_runtime": 41.0245, | |
| "eval_samples_per_second": 4.875, | |
| "eval_steps_per_second": 4.875, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.24444444444444444, | |
| "grad_norm": 0.3317733108997345, | |
| "learning_rate": 8.910000000000001e-05, | |
| "loss": 0.2834, | |
| "mean_token_accuracy": 0.9527689620852471, | |
| "num_tokens": 251659.0, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.26666666666666666, | |
| "grad_norm": 0.28577539324760437, | |
| "learning_rate": 8.81e-05, | |
| "loss": 0.262, | |
| "mean_token_accuracy": 0.9557135447859764, | |
| "num_tokens": 276141.0, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.28888888888888886, | |
| "grad_norm": 0.4030509293079376, | |
| "learning_rate": 8.71e-05, | |
| "loss": 0.26, | |
| "mean_token_accuracy": 0.9594775453209877, | |
| "num_tokens": 299250.0, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.3111111111111111, | |
| "grad_norm": 0.4423465132713318, | |
| "learning_rate": 8.61e-05, | |
| "loss": 0.2557, | |
| "mean_token_accuracy": 0.9583914607763291, | |
| "num_tokens": 323528.0, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.3333333333333333, | |
| "grad_norm": 0.49233391880989075, | |
| "learning_rate": 8.510000000000001e-05, | |
| "loss": 0.2444, | |
| "mean_token_accuracy": 0.9617681756615639, | |
| "num_tokens": 346496.0, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.3333333333333333, | |
| "eval_loss": 0.24680288136005402, | |
| "eval_mean_token_accuracy": 0.963321838080883, | |
| "eval_num_tokens": 346496.0, | |
| "eval_runtime": 41.1525, | |
| "eval_samples_per_second": 4.86, | |
| "eval_steps_per_second": 4.86, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.35555555555555557, | |
| "grad_norm": 0.2696438133716583, | |
| "learning_rate": 8.41e-05, | |
| "loss": 0.2196, | |
| "mean_token_accuracy": 0.9656250089406967, | |
| "num_tokens": 371258.0, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.37777777777777777, | |
| "grad_norm": 0.525949239730835, | |
| "learning_rate": 8.31e-05, | |
| "loss": 0.2122, | |
| "mean_token_accuracy": 0.9669450834393502, | |
| "num_tokens": 395722.0, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.4, | |
| "grad_norm": 0.38804805278778076, | |
| "learning_rate": 8.21e-05, | |
| "loss": 0.2097, | |
| "mean_token_accuracy": 0.9699977666139603, | |
| "num_tokens": 418830.0, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.4222222222222222, | |
| "grad_norm": 0.38709455728530884, | |
| "learning_rate": 8.11e-05, | |
| "loss": 0.1914, | |
| "mean_token_accuracy": 0.9692254871129989, | |
| "num_tokens": 443015.0, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 0.4444444444444444, | |
| "grad_norm": 0.28362640738487244, | |
| "learning_rate": 8.010000000000001e-05, | |
| "loss": 0.2051, | |
| "mean_token_accuracy": 0.968667496740818, | |
| "num_tokens": 465941.0, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.4444444444444444, | |
| "eval_loss": 0.21475830674171448, | |
| "eval_mean_token_accuracy": 0.9686776822805405, | |
| "eval_num_tokens": 465941.0, | |
| "eval_runtime": 40.8312, | |
| "eval_samples_per_second": 4.898, | |
| "eval_steps_per_second": 4.898, | |
| "step": 200 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 1000, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 2254945698432000.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |