Text Generation
Transformers
English
Spanish
iot
smart-home
home-assistant
tool-calling
agent
cybersecurity
devops
ollama
inference-pipeline
autonomous-agent
raspberry-pi
qwen3-coder
Instructions to use MrMoz33/tokioai-coder-iot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MrMoz33/tokioai-coder-iot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MrMoz33/tokioai-coder-iot")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MrMoz33/tokioai-coder-iot", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MrMoz33/tokioai-coder-iot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MrMoz33/tokioai-coder-iot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MrMoz33/tokioai-coder-iot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MrMoz33/tokioai-coder-iot
- SGLang
How to use MrMoz33/tokioai-coder-iot 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 "MrMoz33/tokioai-coder-iot" \ --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": "MrMoz33/tokioai-coder-iot", "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 "MrMoz33/tokioai-coder-iot" \ --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": "MrMoz33/tokioai-coder-iot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MrMoz33/tokioai-coder-iot with Docker Model Runner:
docker model run hf.co/MrMoz33/tokioai-coder-iot
Download examples/openai_client.py from MrMoz33/tokioai-coder-iot: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/MrMoz33/tokioai-coder-iot/resolve/main/examples/openai_client.py
- Command line
-
hf download hf://MrMoz33/tokioai-coder-iot/examples/openai_client.py
-
curl -L -o openai_client.py https://huggingface.co/MrMoz33/tokioai-coder-iot/resolve/main/examples/openai_client.py
1.47 kB
| #!/usr/bin/env python3 | |
| """ | |
| TokioAI Engine -- OpenAI Client Example | |
| Shows how to use TokioAI Engine as a drop-in replacement for OpenAI API. | |
| Prerequisites: | |
| pip install tokioai-engine openai | |
| python -m engine serve --model qwen3-coder --port 8080 | |
| """ | |
| from openai import OpenAI | |
| # Connect to TokioAI Engine (same API as OpenAI) | |
| client = OpenAI( | |
| base_url="http://localhost:8080/v1", | |
| api_key="not-needed", # Engine doesn't require auth | |
| ) | |
| # --- Tool calling --- | |
| print("--- Tool Calling ---") | |
| response = client.chat.completions.create( | |
| model="tokioai-engine", | |
| messages=[{"role": "user", "content": "check what processes are using the most memory"}], | |
| ) | |
| msg = response.choices[0].message | |
| if msg.tool_calls: | |
| for tc in msg.tool_calls: | |
| print(f"Tool: {tc.function.name}") | |
| print(f"Arguments: {tc.function.arguments}") | |
| else: | |
| print(f"Response: {msg.content}") | |
| print() | |
| # --- Text response --- | |
| print("--- Text Response ---") | |
| response = client.chat.completions.create( | |
| model="tokioai-engine", | |
| messages=[{"role": "user", "content": "explain the TCP 3-way handshake in one paragraph"}], | |
| ) | |
| print(f"Response: {response.choices[0].message.content}") | |
| print() | |
| # --- Engine metadata --- | |
| if hasattr(response, "engine_metadata"): | |
| print(f"Intent: {response.engine_metadata['intent']}") | |
| print(f"Confidence: {response.engine_metadata['confidence']}") | |
| print(f"Latency: {response.engine_metadata['latency_ms']}ms") | |