Text Generation
Transformers
Safetensors
GGUF
English
code
code-generation
multimodal
llama
conversational
Instructions to use mrsandip/Alfa-Code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrsandip/Alfa-Code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrsandip/Alfa-Code")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mrsandip/Alfa-Code", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mrsandip/Alfa-Code with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: llama cli -hf mrsandip/Alfa-Code:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: llama cli -hf mrsandip/Alfa-Code:Q4_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: ./llama-cli -hf mrsandip/Alfa-Code:Q4_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf mrsandip/Alfa-Code:Q4_0
Use Docker
docker model run hf.co/mrsandip/Alfa-Code:Q4_0
- LM Studio
- Jan
- vLLM
How to use mrsandip/Alfa-Code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrsandip/Alfa-Code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrsandip/Alfa-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mrsandip/Alfa-Code:Q4_0
- SGLang
How to use mrsandip/Alfa-Code 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 "mrsandip/Alfa-Code" \ --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": "mrsandip/Alfa-Code", "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 "mrsandip/Alfa-Code" \ --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": "mrsandip/Alfa-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use mrsandip/Alfa-Code with Ollama:
ollama run hf.co/mrsandip/Alfa-Code:Q4_0
- Unsloth Desktop
- Docker Model Runner
How to use mrsandip/Alfa-Code with Docker Model Runner:
docker model run hf.co/mrsandip/Alfa-Code:Q4_0
- Lemonade
How to use mrsandip/Alfa-Code with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mrsandip/Alfa-Code:Q4_0
Run and chat with the model
lemonade run user.Alfa-Code-Q4_0
List all available models
lemonade list
- Atomic Chat
File size: 4,576 Bytes
b578034 | 1 2 3 4 5 6 | {"modality": "code+reasoning", "prompt": "Create a Java class which sorts the given array of numbers.\n[9, 2, 4, 3, 6, 1]", "think": "", "answer": "class ArraySort { \n \n void sort(int arr[]) { \n int n = arr.length; \n \n // One by one move boundary of unsorted subarray \n for (int i = 0; i < n-1; i++) { \n \n // Find the minimum element in unsorted array \n int min_index = i; \n for (int j = i+1; j < n; j++) \n if (arr[j] < arr[min_index]) \n min_index = j; \n \n // Swap the found minimum element with the first element \n int temp = arr[min_index]; \n arr[min_index] = arr[i]; \n arr[i] = temp; \n } \n } \n \n // Prints the array \n void printArray(int arr[]) { \n int n = arr.length; \n for (int i=0; i<n; ++i) \n System.out.print(arr[i] + \" \"); \n System.out.println(); \n } \n \n // Driver code to test above \n public static void main(String args[]) \n { \n ArraySort ob = new ArraySort(); \n int arr[] = {9, 2, 4, 3, 6, 1}; \n ob.sort(arr); \n System.out.println(\"Sorted array\"); \n ob.printArray(arr); \n } \n}"}
{"modality": "code+reasoning", "prompt": "Create an algorithm in JavaScript to find the closest pair of points from a given set of points.\nlet points = [[2, 0], [4, 4], [-2, 2], [-3, -4], [4, -2]];", "think": "", "answer": "// algorithm to find closest pair of points \n// uses divide and conquer approach \nconst closestPair = (points) => { \n // base case: two or fewer points\n if (points.length <= 2) {\n return points;\n }\n\n // divide\n const middle = Math.floor(points.length / 2);\n const left = points.slice(0, middle);\n const right = points.slice(middle);\n \n // conquer\n const leftPoints = closestPair(left);\n const rightPoints = closestPair(right);\n\n const closestPair = getClosestPair(leftPoints, rightPoints);\n\n // combine\n return closestPair;\n}\n \n// get closest pair between two sets of points\nconst getClosestPair = (leftPoints, rightPoints) => {\n // calculating the minimum distance\n let minDist = getDistance(leftPoints[0], rightPoints[0]);\n let closestPair = [leftPoints[0], rightPoints[0]];\n \n for (let i = 0; i < leftPoints.length; i++) {\n for (let j = 0; j < rightPoints.length; j++) {\n let dist = getDistance(leftPoints[i], rightPoints[j]);\n if (dist < minDist) {\n minDist = dist;\n closestPair = [leftPoints[i], rightPoints[j]];\n }\n }\n }\n \n // return the minimum distance and its pair\n return closestPair;\n}\n \n// calculate the Euclidean distance between two points\nconst getDistance = (point1, point2) => {\n let xDist = Math.abs(point2[0] - point1[0]);\n let yDist = Math.abs(point2[1] - point1[1]);\n \n return Math.sqrt(Math.pow(xDist, 2) + Math.pow(yDist, 2));\n}\n\n// testing our function \nlet points = [[2, 0], [4, 4], [-2, 2], [-3, -4], [4, -2]];\nlet closestPoints = closestPair(points);\nconsole.log(closestPoints);\n//Output: [[-2, 2], [2, 0]]"}
{"modality": "code+reasoning", "prompt": "Change the following loop so that it prints out the numbers from 10 to 1 in descending order.\nfor i in range(1, 11):\n print(i)", "think": "", "answer": "for i in range(10, 0, -1):\n print(i)"}
{"modality": "code+reasoning", "prompt": "Write an SQL query that returns the 5 most popular books in the library.\nSELECT * FROM libraryBook", "think": "", "answer": "SELECT bookID, bookTitle, COUNT(*) AS Count \nFROM libraryBook \nGROUP BY bookID, bookTitle \nORDER BY Count DESC \nLIMIT 5;"}
{"modality": "code+reasoning", "prompt": "Train an AI model to predict whether an email is spam or not.\n", "think": "", "answer": "import nltk\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.naive_bayes import MultinomialNB\n\n# loading data\ndata = [('This is an email about about a promotion', 'spam'),\n\t('We want to transfer money to your account', 'spam'),\n\t('This email is about programming', 'not_spam'),\n\t('There is a new version of python', 'not_spam'),\n]\n\n# extracting features\nX, y = [], []\nfor feat, lab in data:\n\tX.append(feat)\n\ty.append(lab)\n\ncv = CountVectorizer()\nX_vect = cv.fit_transform(X)\n\n# training the model\nmodel = MultinomialNB()\nmodel.fit(X_vect, y)\n\n# predicting\nprediction = model.predict(cv.transform([\"This is an email about a discount sale\"]))\nprint(prediction)\n\n# Output\n['spam']"}
|