Text Generation
Transformers
Safetensors
Chinese
English
joyai_llm_flash
conversational
custom_code
fp8
Instructions to use jdopensource/JoyAI-LLM-Flash-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jdopensource/JoyAI-LLM-Flash-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jdopensource/JoyAI-LLM-Flash-FP8", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("jdopensource/JoyAI-LLM-Flash-FP8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jdopensource/JoyAI-LLM-Flash-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jdopensource/JoyAI-LLM-Flash-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jdopensource/JoyAI-LLM-Flash-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jdopensource/JoyAI-LLM-Flash-FP8
- SGLang
How to use jdopensource/JoyAI-LLM-Flash-FP8 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 "jdopensource/JoyAI-LLM-Flash-FP8" \ --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": "jdopensource/JoyAI-LLM-Flash-FP8", "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 "jdopensource/JoyAI-LLM-Flash-FP8" \ --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": "jdopensource/JoyAI-LLM-Flash-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jdopensource/JoyAI-LLM-Flash-FP8 with Docker Model Runner:
docker model run hf.co/jdopensource/JoyAI-LLM-Flash-FP8
Download venv/lib/python3.10/site-packages/httpcore/_api.py from jdopensource/JoyAI-LLM-Flash-FP8: direct link, hf CLI and curl.
- Browser
- Download file 3.15 kB
-
https://huggingface.co/jdopensource/JoyAI-LLM-Flash-FP8/resolve/ca4b0370e8cd46c29380d2dff2f9c1ea9efb6ded/venv/lib/python3.10/site-packages/httpcore/_api.py
- Command line
-
hf download hf://jdopensource/JoyAI-LLM-Flash-FP8@ca4b0370e8cd46c29380d2dff2f9c1ea9efb6ded/venv/lib/python3.10/site-packages/httpcore/_api.py
-
curl -L -o _api.py https://huggingface.co/jdopensource/JoyAI-LLM-Flash-FP8/resolve/ca4b0370e8cd46c29380d2dff2f9c1ea9efb6ded/venv/lib/python3.10/site-packages/httpcore/_api.py
3.15 kB
| from __future__ import annotations | |
| import contextlib | |
| import typing | |
| from ._models import URL, Extensions, HeaderTypes, Response | |
| from ._sync.connection_pool import ConnectionPool | |
| def request( | |
| method: bytes | str, | |
| url: URL | bytes | str, | |
| *, | |
| headers: HeaderTypes = None, | |
| content: bytes | typing.Iterator[bytes] | None = None, | |
| extensions: Extensions | None = None, | |
| ) -> Response: | |
| """ | |
| Sends an HTTP request, returning the response. | |
| ``` | |
| response = httpcore.request("GET", "https://www.example.com/") | |
| ``` | |
| Arguments: | |
| method: The HTTP method for the request. Typically one of `"GET"`, | |
| `"OPTIONS"`, `"HEAD"`, `"POST"`, `"PUT"`, `"PATCH"`, or `"DELETE"`. | |
| url: The URL of the HTTP request. Either as an instance of `httpcore.URL`, | |
| or as str/bytes. | |
| headers: The HTTP request headers. Either as a dictionary of str/bytes, | |
| or as a list of two-tuples of str/bytes. | |
| content: The content of the request body. Either as bytes, | |
| or as a bytes iterator. | |
| extensions: A dictionary of optional extra information included on the request. | |
| Possible keys include `"timeout"`. | |
| Returns: | |
| An instance of `httpcore.Response`. | |
| """ | |
| with ConnectionPool() as pool: | |
| return pool.request( | |
| method=method, | |
| url=url, | |
| headers=headers, | |
| content=content, | |
| extensions=extensions, | |
| ) | |
| def stream( | |
| method: bytes | str, | |
| url: URL | bytes | str, | |
| *, | |
| headers: HeaderTypes = None, | |
| content: bytes | typing.Iterator[bytes] | None = None, | |
| extensions: Extensions | None = None, | |
| ) -> typing.Iterator[Response]: | |
| """ | |
| Sends an HTTP request, returning the response within a content manager. | |
| ``` | |
| with httpcore.stream("GET", "https://www.example.com/") as response: | |
| ... | |
| ``` | |
| When using the `stream()` function, the body of the response will not be | |
| automatically read. If you want to access the response body you should | |
| either use `content = response.read()`, or `for chunk in response.iter_content()`. | |
| Arguments: | |
| method: The HTTP method for the request. Typically one of `"GET"`, | |
| `"OPTIONS"`, `"HEAD"`, `"POST"`, `"PUT"`, `"PATCH"`, or `"DELETE"`. | |
| url: The URL of the HTTP request. Either as an instance of `httpcore.URL`, | |
| or as str/bytes. | |
| headers: The HTTP request headers. Either as a dictionary of str/bytes, | |
| or as a list of two-tuples of str/bytes. | |
| content: The content of the request body. Either as bytes, | |
| or as a bytes iterator. | |
| extensions: A dictionary of optional extra information included on the request. | |
| Possible keys include `"timeout"`. | |
| Returns: | |
| An instance of `httpcore.Response`. | |
| """ | |
| with ConnectionPool() as pool: | |
| with pool.stream( | |
| method=method, | |
| url=url, | |
| headers=headers, | |
| content=content, | |
| extensions=extensions, | |
| ) as response: | |
| yield response | |