Instructions to use Gigax/NPC-LLM-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Gigax/NPC-LLM-7B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Gigax/NPC-LLM-7B-GGUF", filename="npc-llm-7B.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Gigax/NPC-LLM-7B-GGUF 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 Gigax/NPC-LLM-7B-GGUF # Run inference directly in the terminal: llama cli -hf Gigax/NPC-LLM-7B-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Gigax/NPC-LLM-7B-GGUF # Run inference directly in the terminal: llama cli -hf Gigax/NPC-LLM-7B-GGUF
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 Gigax/NPC-LLM-7B-GGUF # Run inference directly in the terminal: ./llama-cli -hf Gigax/NPC-LLM-7B-GGUF
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 Gigax/NPC-LLM-7B-GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf Gigax/NPC-LLM-7B-GGUF
Use Docker
docker model run hf.co/Gigax/NPC-LLM-7B-GGUF
- LM Studio
- Jan
- Ollama
How to use Gigax/NPC-LLM-7B-GGUF with Ollama:
ollama run hf.co/Gigax/NPC-LLM-7B-GGUF
- Unsloth Studio
How to use Gigax/NPC-LLM-7B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Gigax/NPC-LLM-7B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Gigax/NPC-LLM-7B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Gigax/NPC-LLM-7B-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Gigax/NPC-LLM-7B-GGUF with Docker Model Runner:
docker model run hf.co/Gigax/NPC-LLM-7B-GGUF
- Lemonade
How to use Gigax/NPC-LLM-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Gigax/NPC-LLM-7B-GGUF
Run and chat with the model
lemonade run user.NPC-LLM-7B-GGUF-{{QUANT_TAG}}List all available models
lemonade list
llm.create_chat_completion(
messages = "No input example has been defined for this model task."
)NPC Model
This repo contains the domain-specific NPC model we've fined-tuned from Mistral-7B, using LoRA.
This model parses a text description of a game scene, and outputs commands like:
say <player1> "Hello Adventurer, care to join me on a quest?greet <player1>attack <player1>- Any other
<action> <param>you add to the prompt! (We call these "skills"!)
β οΈ This model has been trained to overfit on our input prompt format. Follow it closely to reach optimal performance β οΈ
Usage
Make your life easier, use our Python client library
- Instantiating the model using outlines:
from outlines import models
from llama_cpp import Llama
# Download model from the Hugging Face Gigax Hub before run this code
# Our stepper takes in a Outlines model to enable guided generation
# This forces the model to follow our output format
llm = Llama.from_pretrained(
repo_id="Gigax/NPC-LLM-7B-GGUF",
filename="npc-llm-7B.gguf"
# n_gpu_layers=-1, # Uncomment to use GPU acceleration
# seed=1337, # Uncomment to set a specific seed
# n_ctx=2048, # Uncomment to increase the context window
)
model = models.LlamaCpp(llm)
# Instantiate a stepper: handles prompting + output parsing
stepper = NPCStepper(model=model)
- Calling the model on your game's data:
from gigax.parse import CharacterAction
from gigax.scene import (
Character,
Item,
Location,
ProtagonistCharacter,
ProtagonistCharacter,
Skill,
ParameterType,
)
# Use sample data
context = "Medieval world"
current_location = Location(name="Old Town", description="A quiet and peaceful town.")
locations = [current_location] # you can add more locations to the scene
NPCs = [
Character(
name="John the Brave",
description="A fearless warrior",
current_location=current_location,
)
]
protagonist = ProtagonistCharacter(
name="Aldren",
description="Brave and curious",
current_location=current_location,
memories=["Saved the village", "Lost a friend"],
quests=["Find the ancient artifact", "Defeat the evil warlock"],
skills=[
Skill(
name="Attack",
description="Deliver a powerful blow",
parameter_types=[ParameterType.character],
)
],
psychological_profile="Determined and compassionate",
)
items = [Item(name="Sword", description="A sharp blade")]
events = [
CharacterAction(
command="Say",
protagonist=protagonist,
parameters=[items[0], "What a fine sword!"],
)
]
action = stepper.get_action(
context=context,
locations=locations,
NPCs=NPCs,
protagonist=protagonist,
items=items,
events=events,
)
Input prompt
Here's a sample input prompt, showing you the format on which the model has been trained:
- 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 MEMORIES:
Saved the village
Lost a friend
- PROTAGONIST PENDING QUESTS:
Find the ancient artifact
Defeat the evil warlock
- PROTAGONIST ALLOWED ACTIONS:
Attack <character> : Deliver a powerful blow
Aldren:
π€ We are currently working hard on training on the latest SoTA models (Phi-3, LLama, etc.), and on better data ! π€
Model info
- Developed by: Gigax
- Language(s) (NLP): English
- Finetuned from model [optional]: Mistral-7B-instruct
- Contact: Join our Discord for info, help, and more!
How to Cite
@misc{NPC-LLM-7B-GGUF,
url={[https://huggingface.co/Gigax/NPC-LLM-7B-GGUF](https://huggingface.co/Gigax/NPC-LLM-7B-GGUF)},
title={NPC-LLM-7B-GGUF},
author={Gigax team}
}
- Downloads last month
- 36
We're not able to determine the quantization variants.
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Gigax/NPC-LLM-7B-GGUF", filename="npc-llm-7B.gguf", )