Instructions to use teapotai/teapotllm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use teapotai/teapotllm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="teapotai/teapotllm")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("teapotai/teapotllm") model = AutoModelForSeq2SeqLM.from_pretrained("teapotai/teapotllm") - Transformers.js
How to use teapotai/teapotllm with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'teapotai/teapotllm'); - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use teapotai/teapotllm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "teapotai/teapotllm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teapotai/teapotllm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/teapotai/teapotllm
- SGLang
How to use teapotai/teapotllm 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 "teapotai/teapotllm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teapotai/teapotllm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "teapotai/teapotllm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teapotai/teapotllm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use teapotai/teapotllm with Docker Model Runner:
docker model run hf.co/teapotai/teapotllm
it run but
Imports
import fitz # PyMuPDF
from teapotai import TeapotAI
Load and extract text from PDF
pdf_path = '/content/Understanding_Climate_Change.pdf'
doc = fitz.open(pdf_path)
pdf_text = ""
Extract text from all pages
for page in doc:
pdf_text += page.get_text()
doc.close()
Initialize TeapotAI with PDF content as document
teapot_ai = TeapotAI(documents=[pdf_text])
Ask question about Fahd Mirza
query = "What is the topic of the book?"
answer = teapot_ai.query(query=query, context=pdf_text)
_____ _ _ ___ o ;;
| |_ __ _ _ __ ___ | |_ / \ |_ | __ /--_/ /
| |/ _ / ` | ' \ / _ | | / _ \ | | ( | |/
| | _/ (| | |) | () | |_ / ___ \ | | _|~~~~~~~|
||__|_,_| ./ _/ _/ // __| ____/
||
Loading Model: teapotai/teapotllm Revision: 699ab39cbf586674806354e92fbd6179f9a95f4a
Device set to use cpu
Device set to use cpu
Generating embeddings for documents...
Document Embedding: 100%|ββββββββββ| 1/1 [00:04<00:00, 4.37s/doc]
Token indices sequence length is longer than the specified maximum sequence length for this model (12644 > 512). Running this sequence through the model will result in indexing errors
You need to use proper document chunking and rag settings to ensure you don't overfill context.