Instructions to use Gigax/NPC-LLM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gigax/NPC-LLM-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Gigax/NPC-LLM-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Gigax/NPC-LLM-7B") model = AutoModelForCausalLM.from_pretrained("Gigax/NPC-LLM-7B", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gigax/NPC-LLM-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gigax/NPC-LLM-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gigax/NPC-LLM-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Gigax/NPC-LLM-7B
- SGLang
How to use Gigax/NPC-LLM-7B 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 "Gigax/NPC-LLM-7B" \ --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": "Gigax/NPC-LLM-7B", "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 "Gigax/NPC-LLM-7B" \ --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": "Gigax/NPC-LLM-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Gigax/NPC-LLM-7B with Docker Model Runner:
docker model run hf.co/Gigax/NPC-LLM-7B
Commit History
-
update README.md
d3d21e1
-
Update README.md
Verified signaturec9bfb60 -
Update README.md
Verified signature883d609 -
Update README.md
Verified signature# NPC model This repo contains the domain-specific base model we've fine-tuned from Mistral-7B using LoRA. This model can be used to step a NPC in a game or simulation, to make them: * `say <player1> "Hello adventurer, care to join me in a quest?"`, * `attack <player2>` * `greet <player3>` * and any other actions you pass in the model's prompt (we call them `skills`!). Our model has been trained on a very specific format of input prompt. To help you interface with it, we've release a [small python client library available on GitHub](https://github.com/gigaxgames/gigax). 🤗 Stay tuned for more models! 🤗 ## Prompt format ```txt - WORLD KNOWLEDGE: A vast open world full of mystery and adventure. - KNOWN LOCATIONS: Old Town - NPCS: John the Brave - CURRENT LOCATION: Old Town: A quiet and peaceful town. - CURRENT LOCATION ITEMS: Sword - LAST EVENTS: Aldren: Say Sword What a fine sword! - PROTAGONIST NAME: Aldren - PROTAGONIST PSYCHOLOGICAL PROFILE: Brave and curious - PROTAGONIST…6fc1b55 -
Hello world
f733de2 -
initial commit
Verified signature28ab6d3