Instructions to use Fox-AI-by-teolm30/fox1.3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Fox-AI-by-teolm30/fox1.3 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 Fox-AI-by-teolm30/fox1.3 # Run inference directly in the terminal: llama cli -hf Fox-AI-by-teolm30/fox1.3
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Fox-AI-by-teolm30/fox1.3 # Run inference directly in the terminal: llama cli -hf Fox-AI-by-teolm30/fox1.3
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 Fox-AI-by-teolm30/fox1.3 # Run inference directly in the terminal: ./llama-cli -hf Fox-AI-by-teolm30/fox1.3
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 Fox-AI-by-teolm30/fox1.3 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Fox-AI-by-teolm30/fox1.3
Use Docker
docker model run hf.co/Fox-AI-by-teolm30/fox1.3
- LM Studio
- Jan
- Ollama
How to use Fox-AI-by-teolm30/fox1.3 with Ollama:
ollama run hf.co/Fox-AI-by-teolm30/fox1.3
- Unsloth Studio
How to use Fox-AI-by-teolm30/fox1.3 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 Fox-AI-by-teolm30/fox1.3 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 Fox-AI-by-teolm30/fox1.3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Fox-AI-by-teolm30/fox1.3 to start chatting
- Pi
How to use Fox-AI-by-teolm30/fox1.3 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Fox-AI-by-teolm30/fox1.3
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Fox-AI-by-teolm30/fox1.3" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use Fox-AI-by-teolm30/fox1.3 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Fox-AI-by-teolm30/fox1.3
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Fox-AI-by-teolm30/fox1.3" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use Fox-AI-by-teolm30/fox1.3 with Docker Model Runner:
docker model run hf.co/Fox-AI-by-teolm30/fox1.3
- Lemonade
How to use Fox-AI-by-teolm30/fox1.3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Fox-AI-by-teolm30/fox1.3
Run and chat with the model
lemonade run user.fox1.3-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use Fox-AI-by-teolm30/fox1.3 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Fox-AI-by-teolm30/fox1.3
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Fox-AI-by-teolm30/fox1.3
Run Hermes
hermes
- Atomic Chat
File size: 7,328 Bytes
f7a5fb7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | #!/usr/bin/env python3
"""
Fox1.3 Evaluation Script
Evaluates on HumanEval and MBPP benchmarks
"""
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from datasets import load_dataset
import json
import logging
from typing import List, Dict
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
MODEL_NAME = "teolm30/fox1.3"
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
def load_model():
logger.info(f"Loading model: {MODEL_NAME}")
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
return model, tokenizer
def run_humaneval(model, tokenizer) -> Dict:
"""Run HumanEval benchmark."""
logger.info("Loading HumanEval dataset...")
dataset = load_dataset("openai/openai_humaneval", split="test")
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=256,
do_sample=False,
temperature=None,
top_p=None,
device_map="auto"
)
correct = 0
total = len(dataset)
results = []
for i, item in enumerate(dataset):
prompt = item["prompt"]
test = item["test"]
canonical_solution = item["canonical_solution"]
# Extract the prompt up to the function signature
prompt_end = prompt.find("def ")
if prompt_end == -1:
prompt_end = len(prompt)
full_prompt = prompt[:prompt_end]
try:
output = pipe(full_prompt, pad_token_id=tokenizer.eos_token_id)
generated = output[0]["generated_text"]
# Extract code block
code = generated[len(full_prompt):].strip()
# Try to extract just the function body
if "```python" in code:
code = code.split("```python")[1].split("```")[0].strip()
elif "```" in code:
code = code.split("```")[1].split("```")[0].strip()
# Execute the code with the test
exec_globals = {}
exec(code, exec_globals)
exec(test, exec_globals)
# Check if test passed by running it
local_vars = {}
exec(code, local_vars)
try:
exec(test, local_vars)
correct += 1
status = "PASS"
except AssertionError:
status = "FAIL"
except Exception as e:
status = f"ERROR: {str(e)[:50]}"
except Exception as e:
status = f"ERROR: {str(e)[:50]}"
results.append({
"task_id": item.get("task_id", i),
"status": status
})
if (i + 1) % 10 == 0:
logger.info(f"HumanEval progress: {i+1}/{total} | Running pass@{1}: {correct}/{i+1}")
pass_at_1 = correct / total
logger.info(f"HumanEval PASS@1: {pass_at_1:.4f} ({correct}/{total})")
return {
"benchmark": "HumanEval",
"pass_at_1": pass_at_1,
"correct": correct,
"total": total,
"results": results
}
def run_mbpp(model, tokenizer) -> Dict:
"""Run MBPP benchmark."""
logger.info("Loading MBPP dataset...")
dataset = load_dataset("google-research/mbpp", "sanitized", split="test")
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=256,
do_sample=False,
temperature=None,
top_p=None,
device_map="auto"
)
correct = 0
total = min(len(dataset), 374) # Standard subset size
results = []
for i, item in enumerate(dataset[:total]):
prompt = item["prompt"]
test_list = item["test_list"]
code = item["code"]
full_prompt = f"### Instruction:\nWrite a Python function.\n\n### Input:\n{prompt}\n\n### Response:\n"
try:
output = pipe(full_prompt, pad_token_id=tokenizer.eos_token_id)
generated = output[0]["generated_text"]
# Extract code from response
response = generated[len(full_prompt):].strip()
if "```python" in response:
response = response.split("```python")[1].split("```")[0].strip()
elif "```" in response:
response = response.split("```")[1].split("```")[0].strip()
# Test the generated code
exec_globals = {}
exec(response, exec_globals)
all_passed = True
for test_code in test_list:
try:
exec(test_code, exec_globals)
except AssertionError:
all_passed = False
break
except Exception:
all_passed = False
break
if all_passed:
correct += 1
status = "PASS"
else:
status = "FAIL"
except Exception as e:
status = f"ERROR: {str(e)[:50]}"
results.append({
"prompt_id": item.get("prompts_id", i),
"status": status
})
if (i + 1) % 50 == 0:
logger.info(f"MBPP progress: {i+1}/{total} | Running pass@1: {correct}/{i+1}")
pass_at_1 = correct / total
logger.info(f"MBPP PASS@1: {pass_at_1:.4f} ({correct}/{total})")
return {
"benchmark": "MBPP",
"pass_at_1": pass_at_1,
"correct": correct,
"total": total,
"results": results
}
def main():
logger.info(f"Using device: {DEVICE}")
model, tokenizer = load_model()
# Run benchmarks
humaneval_results = run_humaneval(model, tokenizer)
mbpp_results = run_mbpp(model, tokenizer)
# Summary
summary = {
"model": MODEL_NAME,
"benchmarks": {
"HumanEval": {
"pass_at_1": humaneval_results["pass_at_1"],
"correct": humaneval_results["correct"],
"total": humaneval_results["total"]
},
"MBPP": {
"pass_at_1": mbpp_results["pass_at_1"],
"correct": mbpp_results["correct"],
"total": mbpp_results["total"]
}
}
}
logger.info("\n" + "="*50)
logger.info("BENCHMARK RESULTS SUMMARY")
logger.info("="*50)
logger.info(f"HumanEval: {humaneval_results['pass_at_1']:.4f} ({humaneval_results['correct']}/{humaneval_results['total']})")
logger.info(f"MBPP: {mbpp_results['pass_at_1']:.4f} ({mbpp_results['correct']}/{mbpp_results['total']})")
# Save results
output_file = "benchmark_results.json"
with open(output_file, "w") as f:
json.dump(summary, f, indent=2)
logger.info(f"Results saved to {output_file}")
return summary
if __name__ == "__main__":
main()
|