Text Generation
MLX
Safetensors
Hindi
English
Chhattisgarhi
qwen2
hinglish
hindi
indian-languages
edge-ai
small-language-model
on-device-ai
apple-silicon
lora
qwen
bharat
indic-nlp
low-resource
conversational
offline
lightweight
android
Instructions to use eulogik/Bharat-Tiny-LLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use eulogik/Bharat-Tiny-LLM with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("eulogik/Bharat-Tiny-LLM") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use eulogik/Bharat-Tiny-LLM with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "eulogik/Bharat-Tiny-LLM"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "eulogik/Bharat-Tiny-LLM" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use eulogik/Bharat-Tiny-LLM with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "eulogik/Bharat-Tiny-LLM"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default eulogik/Bharat-Tiny-LLM
Run Hermes
hermes
- OpenClaw new
How to use eulogik/Bharat-Tiny-LLM with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "eulogik/Bharat-Tiny-LLM"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "eulogik/Bharat-Tiny-LLM" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use eulogik/Bharat-Tiny-LLM with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "eulogik/Bharat-Tiny-LLM"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "eulogik/Bharat-Tiny-LLM" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eulogik/Bharat-Tiny-LLM", "messages": [ {"role": "user", "content": "Hello"} ] }'
Upload folder using huggingface_hub
Browse files- chat_template.jinja +1 -1
- config.json +31 -70
- model.safetensors +2 -2
- tokenizer_config.json +1 -1
chat_template.jinja
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
{{- "\n" }}
|
| 11 |
{{- tool | tojson }}
|
| 12 |
{%- endfor %}
|
| 13 |
-
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 14 |
{%- else %}
|
| 15 |
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
|
|
|
| 10 |
{{- "\n" }}
|
| 11 |
{{- tool | tojson }}
|
| 12 |
{%- endfor %}
|
| 13 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{{\"name\": <function-name>, \"arguments\": <args-json-object>}}\n</tool_call><|im_end|>\n" }}
|
| 14 |
{%- else %}
|
| 15 |
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
config.json
CHANGED
|
@@ -1,72 +1,33 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
"full_attention",
|
| 34 |
-
"full_attention",
|
| 35 |
-
"full_attention",
|
| 36 |
-
"full_attention",
|
| 37 |
-
"full_attention",
|
| 38 |
-
"full_attention",
|
| 39 |
-
"full_attention",
|
| 40 |
-
"full_attention",
|
| 41 |
-
"full_attention"
|
| 42 |
-
],
|
| 43 |
-
"max_position_embeddings": 131072,
|
| 44 |
-
"max_window_layers": 28,
|
| 45 |
-
"model_type": "qwen2",
|
| 46 |
-
"num_attention_heads": 12,
|
| 47 |
-
"num_hidden_layers": 28,
|
| 48 |
-
"num_key_value_heads": 2,
|
| 49 |
-
"pad_token_id": null,
|
| 50 |
-
"quantization": {
|
| 51 |
-
"group_size": 64,
|
| 52 |
-
"bits": 4,
|
| 53 |
-
"mode": "affine"
|
| 54 |
-
},
|
| 55 |
-
"quantization_config": {
|
| 56 |
-
"group_size": 64,
|
| 57 |
-
"bits": 4,
|
| 58 |
-
"mode": "affine"
|
| 59 |
-
},
|
| 60 |
-
"rms_norm_eps": 1e-06,
|
| 61 |
-
"rope_parameters": {
|
| 62 |
-
"rope_theta": 1000000.0,
|
| 63 |
-
"rope_type": "default"
|
| 64 |
-
},
|
| 65 |
-
"sliding_window": null,
|
| 66 |
-
"tie_word_embeddings": true,
|
| 67 |
-
"transformers_version": "5.12.1",
|
| 68 |
-
"use_cache": true,
|
| 69 |
-
"use_mrope": false,
|
| 70 |
-
"use_sliding_window": false,
|
| 71 |
-
"vocab_size": 151936
|
| 72 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"eos_token_id": 151643,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 1536,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 8960,
|
| 12 |
+
"max_position_embeddings": 32768,
|
| 13 |
+
"max_window_layers": 28,
|
| 14 |
+
"model_type": "qwen2",
|
| 15 |
+
"num_attention_heads": 12,
|
| 16 |
+
"num_hidden_layers": 28,
|
| 17 |
+
"num_key_value_heads": 2,
|
| 18 |
+
"rms_norm_eps": 1e-06,
|
| 19 |
+
"rope_theta": 1000000.0,
|
| 20 |
+
"sliding_window": 32768,
|
| 21 |
+
"tie_word_embeddings": true,
|
| 22 |
+
"torch_dtype": "bfloat16",
|
| 23 |
+
"transformers_version": "4.40.1",
|
| 24 |
+
"use_cache": true,
|
| 25 |
+
"use_mrope": false,
|
| 26 |
+
"use_sliding_window": false,
|
| 27 |
+
"vocab_size": 151936,
|
| 28 |
+
"quantization": {
|
| 29 |
+
"group_size": 64,
|
| 30 |
+
"bits": 4,
|
| 31 |
+
"mode": "affine"
|
| 32 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd74789bdbc4e28de3e028fdce36d2e97e40bc0e5d42278beef20cb6dd8445d5
|
| 3 |
+
size 868629082
|
tokenizer_config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
"backend": "tokenizers",
|
| 4 |
"bos_token": null,
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
-
"eos_token": "<|
|
| 7 |
"errors": "replace",
|
| 8 |
"extra_special_tokens": [
|
| 9 |
"<|im_start|>",
|
|
|
|
| 3 |
"backend": "tokenizers",
|
| 4 |
"bos_token": null,
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
"errors": "replace",
|
| 8 |
"extra_special_tokens": [
|
| 9 |
"<|im_start|>",
|