Instructions to use litert-community/CCORE-Web-Coder-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use litert-community/CCORE-Web-Coder-4B with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli # A single .litertlm file in the repo is picked automatically; otherwise the CLI asks which one to run # (or pass its name right after the repo id). litert-lm run \ --from-huggingface-repo=litert-community/CCORE-Web-Coder-4B \ --prompt="Write me a poem"
- LiteRT
How to use litert-community/CCORE-Web-Coder-4B with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update the 10-minute note for LiteRT-LM 0.20.0 streaming
Browse filesThe card's 10-minute note and the same known issue in litertlm_manifest.json now say that streaming with send_message_async ran past 10 minutes with LiteRT-LM 0.20.0 too, and link the commit on LiteRT-LM's main branch, not in 0.20.0, that makes the blocking send's wait fail only when no progress is made for 10 minutes.
- README.md +1 -1
- litertlm_manifest.json +2 -2
README.md
CHANGED
|
@@ -144,7 +144,7 @@ Peak resident is the process's VmHWM. The GPU engine's memory is not in it. It s
|
|
| 144 |
- **Message whitespace.** The files' chat template keeps the whitespace at the start and end of each message, and the publisher's template removes it. Strip each message to get the publisher's prompt.
|
| 145 |
- **`<|endoftext|>` in a prompt.** A `<|endoftext|>` token (id 248044) in a prompt is treated as padding: the Gated DeltaNet layers get a zero input at that position.
|
| 146 |
- **One engine per conversation.** Create a new engine for each conversation, as every reply on this card did. See [LiteRT-LM #3165](https://github.com/google-ai-edge/LiteRT-LM/issues/3165).
|
| 147 |
-
- **10-minute limit of a blocking send.** With LiteRT-LM 0.20.0, 0.19.0 and 0.18.1, the blocking send (Python `send_message`, C `litert_lm_conversation_send_message`, C++ `Conversation::SendMessage`) fails a reply that is still generating after 10 minutes with `DEADLINE_EXCEEDED`. With
|
| 148 |
- **A message that overflows the context.** With LiteRT-LM 0.19.1 and 0.19.2, once a message failed because it did not fit in the context window, every later message in that conversation failed too, with `Task failed with state: 7`; a new conversation answered. LiteRT-LM 0.20.0 was not checked.
|
| 149 |
- **GPU program cache on Android.** On the Pixel 11 Pro and the Galaxy S26, the second GPU engine loaded the program cache that the first one wrote, and the program cache did not grow. Creating the engine took 47.34 s, then 13.32 s on the Pixel 11 Pro, and 8.65 s, then 6.86 s on the Galaxy S26.
|
| 150 |
- **Phones with 8 GB of memory.** On a phone with 8 GB of memory, the GPU engine of the phone file is not expected to fit: with the file's 16,384-token KV cache, in the eight-question runs, the phone's available memory fell by about 5.65–5.84 GB on the Pixel 11 Pro and 6.06–6.42 GB on the Galaxy S26. The phone file was not run on an 8 GB phone.
|
|
|
|
| 144 |
- **Message whitespace.** The files' chat template keeps the whitespace at the start and end of each message, and the publisher's template removes it. Strip each message to get the publisher's prompt.
|
| 145 |
- **`<|endoftext|>` in a prompt.** A `<|endoftext|>` token (id 248044) in a prompt is treated as padding: the Gated DeltaNet layers get a zero input at that position.
|
| 146 |
- **One engine per conversation.** Create a new engine for each conversation, as every reply on this card did. See [LiteRT-LM #3165](https://github.com/google-ai-edge/LiteRT-LM/issues/3165).
|
| 147 |
+
- **10-minute limit of a blocking send.** With LiteRT-LM 0.20.0, 0.19.0 and 0.18.1, the blocking send (Python `send_message`, C `litert_lm_conversation_send_message`, C++ `Conversation::SendMessage`) fails a reply that is still generating after 10 minutes with `DEADLINE_EXCEEDED`. With all three, streaming with `send_message_async` ran past 10 minutes without it, so a reply that may take longer can be streamed instead. Both were measured with the test model in LiteRT-LM's repository, `runtime/testdata/test_lm_dynamic.litertlm`, not with these files. At the decode speeds in the table, 10 minutes of decoding is about 3,500 to 7,700 tokens (600 s × 5.889 to 12.861 tok/s). On LiteRT-LM's main branch, commit [fb51b498](https://github.com/google-ai-edge/LiteRT-LM/commit/fb51b4980430d0ca67cf6c53e48521b0195a3d76) makes the blocking send's wait fail only when no progress is made for 10 minutes; it is not in 0.20.0.
|
| 148 |
- **A message that overflows the context.** With LiteRT-LM 0.19.1 and 0.19.2, once a message failed because it did not fit in the context window, every later message in that conversation failed too, with `Task failed with state: 7`; a new conversation answered. LiteRT-LM 0.20.0 was not checked.
|
| 149 |
- **GPU program cache on Android.** On the Pixel 11 Pro and the Galaxy S26, the second GPU engine loaded the program cache that the first one wrote, and the program cache did not grow. Creating the engine took 47.34 s, then 13.32 s on the Pixel 11 Pro, and 8.65 s, then 6.86 s on the Galaxy S26.
|
| 150 |
- **Phones with 8 GB of memory.** On a phone with 8 GB of memory, the GPU engine of the phone file is not expected to fit: with the file's 16,384-token KV cache, in the eight-question runs, the phone's available memory fell by about 5.65–5.84 GB on the Pixel 11 Pro and 6.06–6.42 GB on the Galaxy S26. The phone file was not run on an 8 GB phone.
|
litertlm_manifest.json
CHANGED
|
@@ -222,7 +222,7 @@
|
|
| 222 |
"The file's chat template keeps the whitespace at the start and end of each message, and the publisher's template removes it; strip each message to get the publisher's prompt.",
|
| 223 |
"Create a new engine for each conversation, as every reply checked here did (LiteRT-LM #3165, https://github.com/google-ai-edge/LiteRT-LM/issues/3165).",
|
| 224 |
"A <|endoftext|> token (id 248044) in a prompt is treated as padding: the Gated DeltaNet layers get a zero input at that position (all seven signatures of the file compare the input tokens with 248044).",
|
| 225 |
-
"With LiteRT-LM 0.20.0, 0.19.0 and 0.18.1, the blocking send (Python send_message, C litert_lm_conversation_send_message, C++ Conversation::SendMessage) fails a reply that is still generating after 10 minutes with DEADLINE_EXCEEDED. With
|
| 226 |
"With LiteRT-LM 0.19.1 and 0.19.2, once a message failed because it did not fit in the context window, every later message in that conversation failed too, with 'Task failed with state: 7'; a new conversation answered. LiteRT-LM 0.20.0 was not checked."
|
| 227 |
],
|
| 228 |
"context_length": 16384
|
|
@@ -297,7 +297,7 @@
|
|
| 297 |
"The file's chat template keeps the whitespace at the start and end of each message, and the publisher's template removes it; strip each message to get the publisher's prompt.",
|
| 298 |
"Create a new engine for each conversation, as every reply checked here did (LiteRT-LM #3165, https://github.com/google-ai-edge/LiteRT-LM/issues/3165).",
|
| 299 |
"A <|endoftext|> token (id 248044) in a prompt is treated as padding: the Gated DeltaNet layers get a zero input at that position (all seven signatures of the file compare the input tokens with 248044).",
|
| 300 |
-
"With LiteRT-LM 0.20.0, 0.19.0 and 0.18.1, the blocking send (Python send_message, C litert_lm_conversation_send_message, C++ Conversation::SendMessage) fails a reply that is still generating after 10 minutes with DEADLINE_EXCEEDED. With
|
| 301 |
"With LiteRT-LM 0.19.1 and 0.19.2, once a message failed because it did not fit in the context window, every later message in that conversation failed too, with 'Task failed with state: 7'; a new conversation answered. LiteRT-LM 0.20.0 was not checked."
|
| 302 |
],
|
| 303 |
"context_length": 32768
|
|
|
|
| 222 |
"The file's chat template keeps the whitespace at the start and end of each message, and the publisher's template removes it; strip each message to get the publisher's prompt.",
|
| 223 |
"Create a new engine for each conversation, as every reply checked here did (LiteRT-LM #3165, https://github.com/google-ai-edge/LiteRT-LM/issues/3165).",
|
| 224 |
"A <|endoftext|> token (id 248044) in a prompt is treated as padding: the Gated DeltaNet layers get a zero input at that position (all seven signatures of the file compare the input tokens with 248044).",
|
| 225 |
+
"With LiteRT-LM 0.20.0, 0.19.0 and 0.18.1, the blocking send (Python send_message, C litert_lm_conversation_send_message, C++ Conversation::SendMessage) fails a reply that is still generating after 10 minutes with DEADLINE_EXCEEDED. With all three, streaming with send_message_async ran past 10 minutes without it, so a reply that may take longer can be streamed instead. Both were measured with the test model in LiteRT-LM's repository, runtime/testdata/test_lm_dynamic.litertlm, not with this file. On LiteRT-LM's main branch, commit fb51b498 (https://github.com/google-ai-edge/LiteRT-LM/commit/fb51b4980430d0ca67cf6c53e48521b0195a3d76) makes the blocking send's wait fail only when no progress is made for 10 minutes; it is not in 0.20.0.",
|
| 226 |
"With LiteRT-LM 0.19.1 and 0.19.2, once a message failed because it did not fit in the context window, every later message in that conversation failed too, with 'Task failed with state: 7'; a new conversation answered. LiteRT-LM 0.20.0 was not checked."
|
| 227 |
],
|
| 228 |
"context_length": 16384
|
|
|
|
| 297 |
"The file's chat template keeps the whitespace at the start and end of each message, and the publisher's template removes it; strip each message to get the publisher's prompt.",
|
| 298 |
"Create a new engine for each conversation, as every reply checked here did (LiteRT-LM #3165, https://github.com/google-ai-edge/LiteRT-LM/issues/3165).",
|
| 299 |
"A <|endoftext|> token (id 248044) in a prompt is treated as padding: the Gated DeltaNet layers get a zero input at that position (all seven signatures of the file compare the input tokens with 248044).",
|
| 300 |
+
"With LiteRT-LM 0.20.0, 0.19.0 and 0.18.1, the blocking send (Python send_message, C litert_lm_conversation_send_message, C++ Conversation::SendMessage) fails a reply that is still generating after 10 minutes with DEADLINE_EXCEEDED. With all three, streaming with send_message_async ran past 10 minutes without it, so a reply that may take longer can be streamed instead. Both were measured with the test model in LiteRT-LM's repository, runtime/testdata/test_lm_dynamic.litertlm, not with this file. On LiteRT-LM's main branch, commit fb51b498 (https://github.com/google-ai-edge/LiteRT-LM/commit/fb51b4980430d0ca67cf6c53e48521b0195a3d76) makes the blocking send's wait fail only when no progress is made for 10 minutes; it is not in 0.20.0.",
|
| 301 |
"With LiteRT-LM 0.19.1 and 0.19.2, once a message failed because it did not fit in the context window, every later message in that conversation failed too, with 'Task failed with state: 7'; a new conversation answered. LiteRT-LM 0.20.0 was not checked."
|
| 302 |
],
|
| 303 |
"context_length": 32768
|