Text Generation
Transformers
Safetensors
English
qwen3
tool-calling
function-calling
lora
sft
trl
zynthetix
conversational
text-generation-inference
Instructions to use karthik-2905/AL1-model-B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use karthik-2905/AL1-model-B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="karthik-2905/AL1-model-B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("karthik-2905/AL1-model-B") model = AutoModelForCausalLM.from_pretrained("karthik-2905/AL1-model-B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use karthik-2905/AL1-model-B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "karthik-2905/AL1-model-B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "karthik-2905/AL1-model-B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/karthik-2905/AL1-model-B
- SGLang
How to use karthik-2905/AL1-model-B 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 "karthik-2905/AL1-model-B" \ --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": "karthik-2905/AL1-model-B", "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 "karthik-2905/AL1-model-B" \ --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": "karthik-2905/AL1-model-B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use karthik-2905/AL1-model-B with Docker Model Runner:
docker model run hf.co/karthik-2905/AL1-model-B
| { | |
| "model": "Qwen/Qwen3-0.6B", | |
| "adapter": null, | |
| "n": 10, | |
| "results": [ | |
| { | |
| "id": "chat_1", | |
| "kind": "general", | |
| "query": "Explain what a hash map is in two sentences.", | |
| "reply": "A hash map is a data structure that stores key-value pairs, where each key is mapped to a specific value." | |
| }, | |
| { | |
| "id": "chat_2", | |
| "kind": "code", | |
| "query": "Write a Python function that reverses a string.", | |
| "reply": "Here's a simple Python function that reverses a string:\n\n```python\ndef reverse_string(s):\n return s[::-1]\n```\n\n### Example usage:\n```python\nprint(reverse_string(\"hello\")) # Output: \"olleh\"\nprint(reverse_string(\"Python\")) # Output: \"nohtyP\")\n```" | |
| }, | |
| { | |
| "id": "chat_3", | |
| "kind": "general", | |
| "query": "What's the difference between TCP and UDP?", | |
| "reply": "TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are both transport protocols used in networking, but they differ in several key aspects:\n\n### 1. **Purpose**\n- **TCP**: Used for reliable, connection-oriented communication. It ensures that data is delivered exactly as expected, with no loss or delay.\n- **UDP**: Used for fast, unreliable communication. It does not guarantee delivery, and data can be lost or delayed.\n\n### 2. **Reliability**\n- **TCP**: Guarantees that data is delivered exactly as expected, with no loss or delay.\n- **UDP**: Does not guarantee delivery, so data can be lost or delayed.\n\n### 3. **Connection-Oriented vs. Connectionless**\n- **TCP**: Uses a connection-oriented approach, requiring a connection to be established before communication begins.\n- **UDP**: Uses a connectionless approach, allowing communication to occur without a connection.\n\n### 4. **Speed**\n- **UDP**: Generally faster than TCP, especially for applications that require minimal delay.\n- **TCP**: Slower, but reliable.\n\n### 5. **Use Cases**\n- **TCP**: Used in applications that require high reliability (e.g., email, file transfers, real-time video streaming).\n- **" | |
| }, | |
| { | |
| "id": "chat_4", | |
| "kind": "code", | |
| "query": "Write a bash one-liner to count the total lines across all .py files in a folder.", | |
| "reply": "You can use the following one-liner in Bash to count the total number of lines across all `.py` files in a folder:\n\n```bash\nfind . -type f -name \"*.py\" | wc -l\n```\n\nThis command:\n\n- Uses `find` to search for all `.py` files in the current directory and subdirectories.\n- Counts the number of files using `wc -l`, which counts the number of lines in each file.\n\nLet me know if you'd like to count the total number of lines across all files in a specific directory!" | |
| }, | |
| { | |
| "id": "chat_5", | |
| "kind": "general", | |
| "query": "Give me three practical tips for better sleep.", | |
| "reply": "Here are three practical tips to improve your sleep quality:\n\n1. **Limit screen time before bed**: Avoid using electronic devices, especially phones and computers, 1-2 hours before bedtime. This helps reduce the amount of blue light that affects your circadian rhythm.\n\n2. **Create a relaxing bedtime routine**: Engage in activities that promote relaxation, such as reading, listening to calming music, or taking a warm bath. This helps signal to your body that it's time to sleep.\n\n3. **Stick to a consistent sleep schedule**: Go to bed and wake up at the same time every day, even on weekends. This helps regulate your body's internal clock and improves sleep quality." | |
| }, | |
| { | |
| "id": "chat_6", | |
| "kind": "code", | |
| "query": "Write a Python function to check whether a number is prime.", | |
| "reply": "Here's a simple Python function to check whether a number is prime:\n\n```python\ndef is_prime(n):\n if n <= 1:\n return False\n if n == 2:\n return True\n if n % 2 == 0:\n return False\n i = 3\n while i * i <= n:\n if n % i == 0:\n return False\n i += 2\n return True\n```\n\n### Example usage:\n\n```python\nprint(is_prime(2)) # True\nprint(is_prime(3)) # True\nprint(is_prime(4)) # False\nprint(is_prime(9)) # False\nprint(is_prime(10)) # False\n```\n\n### Notes:\n- The function checks for even numbers first (i.e., 2 and 4, 6, etc.).\n- It then checks for odd divisors starting from 3.\n- Returns `False` if any divisor is found." | |
| }, | |
| { | |
| "id": "chat_7", | |
| "kind": "general", | |
| "query": "I keep procrastinating on a side project. Give me concrete advice.", | |
| "reply": "Procrastination is a common challenge, but here are some concrete and actionable steps you can take to overcome it:\n\n### 1. **Set Clear Goals**\n - Break your side project into smaller, manageable tasks.\n - Use the **SMART goal framework** (Specific, Measurable, Achievable, Relevant, Time-bound).\n\n### 2. **Create a Schedule**\n - Set a daily or weekly schedule for your work.\n - Use tools like **Trello**, **Notion**, or **Google Calendar** to organize your tasks.\n\n### 3. **Break It Down**\n - If you're stuck, start with one task at a time.\n - Focus on one task until it's done, then move on.\n\n### 4. **Use Time Management Techniques**\n - ** Pomodoro Technique**: Work for 25 minutes, then take a 5-minute break.\n - ** Pomodoro**: Focus for 25 minutes, then take a 5-minute break.\n\n### 5. **Set a Deadline**\n - Assign a specific deadline to your project to create urgency.\n\n### 6. **Eliminate Distractions**\n - Turn off notifications, close unnecessary apps, and focus on your work.\n\n### " | |
| }, | |
| { | |
| "id": "chat_8", | |
| "kind": "code", | |
| "query": "Write a SQL query returning the top 5 customers by total order value from an orders table.", | |
| "reply": "To return the **top 5 customers by total order value** from the `orders` table, you can use a **subquery** to calculate the total order value for each customer and then order the results by that value in descending order. Here's the SQL query:\n\n```sql\nSELECT \n customer_id,\n SUM(order_value) AS total_order_value\nFROM orders\nGROUP BY customer_id\nORDER BY total_order_value DESC\nLIMIT 5;\n```\n\n### Explanation:\n- `SUM(order_value)` calculates the total order value for each customer.\n- `GROUP BY customer_id` groups the results by customer ID.\n- `ORDER BY total_order_value DESC` sorts the results in descending order of total order value.\n- `LIMIT 5` returns only the top 5 results.\n\nLet me know if you want to include other fields or have additional filtering!" | |
| }, | |
| { | |
| "id": "chat_9", | |
| "kind": "general", | |
| "query": "Summarize the plot of Romeo and Juliet in three lines.", | |
| "reply": "Romeo and Juliet meet in a tragic love story, where their families are in conflict, and their love is doomed to end." | |
| }, | |
| { | |
| "id": "chat_10", | |
| "kind": "code", | |
| "query": "Write a Python list comprehension that returns the squares of even numbers from 0 to 20.", | |
| "reply": "Here's a Python list comprehension that returns the squares of even numbers from 0 to 20:\n\n```python\nsquares = [x**2 for x in range(0, 21) if x % 2 == 0]\n```\n\n### Explanation:\n- `range(0, 21)` generates numbers from 0 to 20 (inclusive).\n- `x % 2 == 0` checks if `x` is even.\n- `x**2` computes the square of each even number.\n- The list comprehension returns the resulting list." | |
| } | |
| ] | |
| } |