Instructions to use matt0xdev/Affine-dark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use matt0xdev/Affine-dark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="matt0xdev/Affine-dark") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("matt0xdev/Affine-dark") model = AutoModelForCausalLM.from_pretrained("matt0xdev/Affine-dark", 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 matt0xdev/Affine-dark with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "matt0xdev/Affine-dark" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "matt0xdev/Affine-dark", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/matt0xdev/Affine-dark
- SGLang
How to use matt0xdev/Affine-dark 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 "matt0xdev/Affine-dark" \ --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": "matt0xdev/Affine-dark", "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 "matt0xdev/Affine-dark" \ --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": "matt0xdev/Affine-dark", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use matt0xdev/Affine-dark with Docker Model Runner:
docker model run hf.co/matt0xdev/Affine-dark
| import os | |
| from chutes.chute import NodeSelector | |
| from chutes.chute.template.sglang import build_sglang_chute | |
| os.environ["NO_PROXY"] = "localhost,127.0.0.1" | |
| chute = build_sglang_chute( | |
| username="ryan888", | |
| readme="matt0xdev/affine-5CY88hoZChb9NGTvss5LDHddPrmZ4LJb4q2cSESAVoAt1qcX", | |
| model_name="matt0xdev/affine-5CY88hoZChb9NGTvss5LDHddPrmZ4LJb4q2cSESAVoAt1qcX", | |
| image="chutes/sglang:nightly-2025091100", | |
| concurrency=24, | |
| revision="8a9ca7839281a9b859a04a4c7c2350718fe89975", | |
| node_selector=NodeSelector( | |
| gpu_count=8, | |
| include=["h100_nvl", "pro_6000", "l40", "a40", "a100", "a100_sxm", "h800", "h100", "a6000_ada", "h20", "l40s", "h200"], | |
| ), | |
| engine_args=( | |
| "--context-length 262144 " | |
| "--tool-call-parser qwen25 " | |
| "--attention-backend fa3 " | |
| "--cuda-graph-max-bs 24 " | |
| ), | |
| shutdown_after_seconds=1600, | |
| ) | |