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.2222222222222222, | |
| "eval_steps": 50, | |
| "global_step": 100, | |
| "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 | |
| } | |
| ], | |
| "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": 1094077520640000.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |