Text Generation
Transformers
Safetensors
Spanish
English
phi
bittensor
subnet-20
bitagent
phi2
lora
bfcl
tool-calling
text-generation-inference
Instructions to use Tonit23/antonio-phi2-bitagent-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tonit23/antonio-phi2-bitagent-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tonit23/antonio-phi2-bitagent-merged")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Tonit23/antonio-phi2-bitagent-merged") model = AutoModelForCausalLM.from_pretrained("Tonit23/antonio-phi2-bitagent-merged", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Tonit23/antonio-phi2-bitagent-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tonit23/antonio-phi2-bitagent-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tonit23/antonio-phi2-bitagent-merged", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Tonit23/antonio-phi2-bitagent-merged
- SGLang
How to use Tonit23/antonio-phi2-bitagent-merged 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 "Tonit23/antonio-phi2-bitagent-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tonit23/antonio-phi2-bitagent-merged", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Tonit23/antonio-phi2-bitagent-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tonit23/antonio-phi2-bitagent-merged", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Tonit23/antonio-phi2-bitagent-merged with Docker Model Runner:
docker model run hf.co/Tonit23/antonio-phi2-bitagent-merged
| pipeline_tag: text-generation | |
| license: mit | |
| language: | |
| - es | |
| - en | |
| tags: | |
| - bittensor | |
| - subnet-20 | |
| - bitagent | |
| - phi2 | |
| - lora | |
| - bfcl | |
| - tool-calling | |
| base_model: microsoft/phi-2 | |
| library_name: transformers | |
| model_type: causal-lm | |
| inference: true | |
| # 🚀 Antonio Phi-2 BitAgent Merged (Subnet-20) | |
| **Autor:** [@Tonit23](https://huggingface.co/Tonit23) | |
| **Base:** `microsoft/phi-2` | |
| **Fine-tune:** [`antonio-phi2-bitagent-lora`](https://huggingface.co/Tonit23/antonio-phi2-bitagent-lora) | |
| **Subnet:** 🧠 [Bittensor Subnet-20 — BitAgent](https://rizzo.network/subnet-20/) | |
| **Publicación:** octubre 2025 | |
| --- | |
| ## 🧩 Descripción general | |
| `antonio-phi2-bitagent-merged` es una versión **LoRA-fusionada** del modelo `microsoft/phi-2`, adaptada específicamente para el entorno **BitAgent (SN20)** dentro del ecosistema **Bittensor Finney**. | |
| Este modelo está optimizado para tareas de **razonamiento en español e inglés**, **inferencia compacta** y **tool-calling semántico** (uso de funciones o herramientas internas), usando un esquema compatible con los validadores SN20. | |
| --- | |
| ## ⚙️ Detalles técnicos | |
| | Propiedad | Valor | | |
| |-------------------------|-------| | |
| | Modelo base | `microsoft/phi-2` | | |
| | Fine-tune | `LoRA` sobre dataset de prompts técnicos BFCL | | |
| | Parámetros totales | ~7.24 B | | |
| | Parámetros entrenables | 3.4 M (0.047 %) | | |
| | Framework | PyTorch + Transformers + PEFT | | |
| | Licencia | MIT | | |
| | Hardware objetivo | CPU / GPU (float16) | | |
| ### Entrenamiento | |
| El modelo fue fine-tuneado con **LoRA (Low-Rank Adaptation)** en un conjunto de datos mixto de tareas técnicas: | |
| - prompts de razonamiento lógico, instrucciones BFCL y tool-calling | |
| - pares entrada/salida basados en análisis ABAP y Python | |
| - mezclas en español e inglés | |
| --- | |
| ## 🧠 Uso | |
| ### Inferencia local (Transformers) | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| import torch | |
| model = AutoModelForCausalLM.from_pretrained("Tonit23/antonio-phi2-bitagent-merged", torch_dtype=torch.float16) | |
| tokenizer = AutoTokenizer.from_pretrained("Tonit23/antonio-phi2-bitagent-merged") | |
| prompt = "Explica el proceso de staking en la red Bittensor Finney:" | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| outputs = model.generate(**inputs, max_new_tokens=200) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |