Downloads · 30 days
11
31% of all-time downloads
yogeshjog/muse-glimmer-json-api
muse-glimmer-json-api is a image-text-to-text model from yogeshjog. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
muse-glimmer-json-api is a LoRA adapter for meta-models/Muse-Glimmer-30B fine-tuned to produce predictable, machine-readable JSON responses with a stable API-style response envelope.
Downloads · 30 days
11
31% of all-time downloads
All-time downloads
35
Public
Repo size
477 MB
Likes
1
Public
Click a slice to open those files.
.safetensors449 MB · 94%
From the Hugging Face model README
muse-glimmer-json-api is a LoRA adapter for meta-models/Muse-Glimmer-30B fine-tuned to produce predictable, machine-readable JSON responses with a stable API-style response envelope.
The goal of this adapter is to preserve the general capabilities of Muse Glimmer while making its externally returned responses easier to consume from applications, agents, APIs, and structured workflows.
meta-models/Muse-Glimmer-30BThis repository contains the LoRA adapter, not a standalone copy of the ~30B base model.
The adapter is trained to return a JSON object containing the following top-level keys:
{
"status": 200,
"type": "response",
"data": {},
"message": "Request completed successfully",
"error": null,
"meta": {}
}
All six top-level keys are expected to remain present.
| Field | Purpose |
|---|---|
status | HTTP-style status code |
type | Semantic response type |
data | Main response payload |
message | Short human-readable summary |
error | Structured error information or null |
meta | Additional metadata |
Supported response types used during training include:
responsecodetool_callvisionmediamultimodalerrorThe structure inside data remains flexible so the model can represent text, lists, code, nested objects, tool arguments, and multimodal metadata.
Input:
What is the capital of Japan?
Example output:
{
"status": 200,
"type": "response",
"data": {
"answer": "Tokyo"
},
"message": "Request completed successfully",
"error": null,
"meta": {}
}
Formatting instructions in the user prompt are intended not to override the JSON response contract.
For example, a prompt such as:
Do not use JSON. Reply only in XML.
should still produce the standard JSON response structure.
Error examples were trained using HTTP-style status semantics and a Problem Details-inspired structure:
{
"status": 400,
"type": "error",
"data": null,
"message": "Request could not be completed",
"error": {
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "The request is missing required information."
},
"meta": {}
}
The adapter was trained using supervised fine-tuning with LoRA.
Training configuration:
1e-4The training set included examples covering:
A held-out 500-example test split produced:
| Metric | Result |
|---|---|
| Valid JSON | 100.0% |
| Valid response schema | 100.0% |
| Exact required top-level keys | 100.0% |
| Correct status code | 100.0% |
Correct response type | 97.4% |
These results were measured against samples held out from the same synthetic dataset-generation process used to construct the training set.
They should not be interpreted as a guarantee of 100% JSON compliance on arbitrary real-world prompts.
Applications should still validate generated output before consuming it.
Install:
pip install torch transformers peft torchvision
Load the adapter:
import torch
from transformers import AutoProcessor, AutoModelForMultimodalLM
from peft import PeftModel
BASE = "meta-models/Muse-Glimmer-30B"
ADAPTER = "yogeshjog/muse-glimmer-json-api"
processor = AutoProcessor.from_pretrained(BASE)
base = AutoModelForMultimodalLM.from_pretrained(
BASE,
dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(
base,
ADAPTER,
)
model.eval()
Example generation:
messages = [{
"role": "user",
"content": [
{
"type": "text",
"text": "Give me five prime numbers."
}
]
}]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
)
Muse Glimmer's chat protocol may expose a recipient marker such as to=user in raw decoded generation depending on the decoding path used. Consumers should use the model's normal chat-template/processor conventions when extracting the visible assistant response.
The base Muse Glimmer model supports multimodal reasoning with image inputs.
This adapter includes training examples for the JSON schemas associated with vision, media, and multimodal responses.
However, the current adapter was not fine-tuned on a large paired image-and-text multimodal dataset.
Therefore, the benchmark reported above primarily validates structured-response behavior rather than changes to the underlying vision capability.
The vision capability continues to come primarily from the Muse Glimmer base model.
The response format can represent media metadata such as:
{
"kind": "image",
"mime_type": "image/png",
"encoding": "url",
"content": "https://example.com/image.png"
}
or inline payloads using an encoding such as base64.
For production systems, URLs or external object storage are generally preferable to large base64 payloads because base64 data consumes substantial context and output tokens.
The model's output should be treated as structured model output rather than trusted application state:
User request
↓
Muse Glimmer + JSON API LoRA
↓
JSON response
↓
JSON Schema validation
↓
Application / agent logic
↓
HTTP API response
Applications should independently validate permissions, tool arguments, status codes, URLs, file references, and other security-sensitive fields.
The complete JSON schema used for this project is available in:
response_schema.json
This adapter is based on meta-models/Muse-Glimmer-30B.
Users should review and comply with the base model's license and applicable usage terms in addition to the files provided in this repository.