Skip to content

Commit 14bc711

Browse files
arpannookala-12HarikaHarikaDev296
authored
cld2labs/TinyLlama-1.1B-Chat-v1.0 (#94)
* feat: add TinyLlama-1.1B-Chat-v1.0 model card and deployment guide for Dell EI Signed-off-by: arpannookala-12 <ganesh.arpan.nookala@cloud2labs.com> * update tinyllama deployment guide * Enable ingress and update deployment instructions * update tinyllama deployment.md * update tinyllama deployment.md * update tinyllama deployment.md * Remove README.md from model-deployment folder --------- Signed-off-by: arpannookala-12 <ganesh.arpan.nookala@cloud2labs.com> Co-authored-by: Harika <codewith3@gmail.com> Co-authored-by: Harika <harika.devulapally@cloud2labs.com>
1 parent 70197c7 commit 14bc711

2 files changed

Lines changed: 173 additions & 0 deletions

File tree

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
## Step 1: Prerequisites to Deploy TinyLlama Model on Xeon with Keycloak
2+
3+
Ensure the Enterprise Inference stack with Keycloak is already deployed before proceeding.
4+
5+
Edit `core/scripts/generate-token.sh` and set your values before sourcing it:
6+
7+
| Variable | Description |
8+
| ------------------------- | ------------------------------------------------------------------------ |
9+
| `BASE_URL` | Hostname of your cluster (e.g. `api.example.com`), without `https://` |
10+
| `KEYCLOAK_ADMIN_USERNAME` | Keycloak admin username |
11+
| `KEYCLOAK_PASSWORD` | Keycloak admin password |
12+
| `KEYCLOAK_CLIENT_ID` | Keycloak client ID configured during EI deployment |
13+
14+
Then run:
15+
16+
```bash
17+
export HUGGING_FACE_HUB_TOKEN="your_token_here"
18+
19+
cd ~/Enterprise-Inference
20+
source core/scripts/generate-token.sh
21+
```
22+
23+
This exports: `BASE_URL`, `KEYCLOAK_CLIENT_ID`, `KEYCLOAK_CLIENT_SECRET`, and `TOKEN`.
24+
25+
## Step 2: Deploy Tinyllama-1.1b-chat-v1.0 Model
26+
27+
```bash
28+
helm install tinyllama-1-1b-cpu ./core/helm-charts/vllm \
29+
--values ./core/helm-charts/vllm/xeon-values.yaml \
30+
--set LLM_MODEL_ID="TinyLlama/TinyLlama-1.1B-Chat-v1.0" \
31+
--set global.HUGGINGFACEHUB_API_TOKEN="$HUGGING_FACE_HUB_TOKEN" \
32+
--set ingress.enabled=true \
33+
--set ingress.secretname="${BASE_URL}" \
34+
--set ingress.host="${BASE_URL}" \
35+
--set oidc.client_id="$KEYCLOAK_CLIENT_ID" \
36+
--set oidc.client_secret="$KEYCLOAK_CLIENT_SECRET" \
37+
--set apisix.enabled=true \
38+
--set tensor_parallel_size="1" \
39+
--set pipeline_parallel_size="1"
40+
```
41+
42+
## Step 3: Verify the Deployment
43+
44+
```bash
45+
kubectl get pods
46+
kubectl get apisixroutes
47+
```
48+
49+
Expected Output:
50+
51+
```
52+
NAME READY STATUS RESTARTS
53+
keycloak-0 1/1 Running 0
54+
keycloak-postgresql-0 1/1 Running 0
55+
tinyllama-1-1b-cpu-vllm-<hash>-<hash> 1/1 Running 0
56+
```
57+
58+
> Note: The pod name suffix `<hash>-<hash>` is auto-generated by Kubernetes and will differ on each deployment. Ensure all pods show `1/1 Running`.
59+
60+
```
61+
NAME HOSTS
62+
tinyllama-1-1b-cpu-vllm-apisixroute api.example.com
63+
```
64+
65+
## Step 4: Test the Deployed Model
66+
67+
```bash
68+
curl -k https://${BASE_URL}/tinyLlama-1.1B-Chat-v1.0-vllmcpu/v1/completions \
69+
-X POST \
70+
-H "Content-Type: application/json" \
71+
-H "Authorization: Bearer $TOKEN" \
72+
-d '{
73+
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
74+
"prompt": "What is Deep Learning?",
75+
"max_tokens": 25,
76+
"temperature": 0
77+
}'
78+
```
79+
80+
If successful, the model will return a completion response.
81+
82+
## To undeploy the model
83+
84+
```bash
85+
helm uninstall tinyllama-1-1b-cpu
86+
```
87+
88+
## Parameters
89+
90+
| Parameter | Description |
91+
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
92+
| `--set LLM_MODEL_ID="TinyLlama/TinyLlama-1.1B-Chat-v1.0"` | Defines the target model from **Hugging Face** to deploy. |
93+
| `--set global.HUGGINGFACEHUB_API_TOKEN="..."` | Authenticates access to gated or private Hugging Face models. Replace with your own secure token. |
94+
| `--set ingress.enabled=true` | Enables Kubernetes **Ingress** to expose the model service externally. |
95+
| `--set ingress.host="replace-ingress"` | Public hostname or FQDN for the inference endpoint (maps to your Ingress controller IP). |
96+
| `--set ingress.secretname="replace-secret"` | Kubernetes **TLS Secret** used for HTTPS termination at the ingress layer. |
97+
| `--set oidc.client_id="..."` | Keycloak OIDC client ID used for token-based authentication. |
98+
| `--set oidc.client_secret="..."` | Keycloak OIDC client secret corresponding to the client ID. |
99+
| `--set apisix.enabled=true` | Enables **APISIX** as the API gateway for routing and authentication. |
100+
| `--set tensor_parallel_size="1"` | Number of tensor parallel workers. Set to the number of available CPUs/GPUs per node. |
101+
| `--set pipeline_parallel_size="1"` | Number of pipeline parallel stages. Typically `1` for single-node deployments. |
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# TinyLlama-1.1B-Chat-v1.0
2+
3+
This model uses TinyLlama-1.1B-Chat-v1.0, a compact large language model developed by the TinyLlama Project team. It is a chat-tuned variant of the TinyLlama 1.1B base model, optimized for instruction-following, conversational AI, and lightweight reasoning tasks. Despite its small size, TinyLlama delivers strong performance for edge AI, embedded systems, rapid prototyping, and cost-efficient inference scenarios.
4+
5+
For full details including model specifications, licensing, intended use, safety guidance, and example prompts, please visit the official Hugging Face page: **Official Hugging Face Page**
6+
7+
https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0
8+
9+
This model provides inference services only; weights are hosted by Hugging Face under the Apache 2.0 License.
10+
11+
Ensure compliance with the Apache 2.0 License terms before using this model.
12+
13+
### Model Attribution
14+
15+
**Developer:** TinyLlama Project
16+
17+
**purpose:** Lightweight instruction-tuned conversational AI
18+
19+
**Sizes/Variants:** 1.1B parameters
20+
21+
**Modalities:** Text → Natural Language
22+
23+
**Parameter Size:** 1.1 Billion
24+
25+
**Max Context:** ~2K tokens
26+
27+
**License:** Apache 2.0 (commercial-friendly)
28+
29+
### Usage Notice
30+
31+
**By using this model, you agree that:**
32+
33+
- Inputs and outputs are processed by the TinyLlama-1.1B-Chat-v1.0 model under the Apache 2.0 license.
34+
- You are responsible for validating outputs before production use.
35+
- This model should not be used for generating malicious, deceptive, or unsafe content.
36+
- Outputs may contain inaccuracies and must be reviewed for correctness and compliance.
37+
38+
### Intended Applications
39+
40+
- Lightweight chatbots and virtual assistants
41+
- Edge AI and on-device inference
42+
- Rapid prototyping and AI experimentation
43+
- CPU-based conversational agents
44+
- Educational tools and demos
45+
- RAG-based document assistants for low-resource environments
46+
- Dev/test automation helpers
47+
48+
### Limitations
49+
50+
- Limited reasoning depth compared to large models (7B+)
51+
- Reduced long-context understanding
52+
- Not suitable for complex multi-step logic or heavy code generation
53+
- May hallucinate or oversimplify responses
54+
- Not designed for safety-critical or regulated decision systems
55+
56+
### References
57+
58+
TinyLlama Project — https://github.com/jzhang38/TinyLlama
59+
60+
Hugging Face Model Page — https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0

0 commit comments

Comments
 (0)