Instructions to use edsoncarvalhointuria/merged-schema-forg-ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use edsoncarvalhointuria/merged-schema-forg-ai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="edsoncarvalhointuria/merged-schema-forg-ai", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("edsoncarvalhointuria/merged-schema-forg-ai", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("edsoncarvalhointuria/merged-schema-forg-ai", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use edsoncarvalhointuria/merged-schema-forg-ai with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "edsoncarvalhointuria/merged-schema-forg-ai" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "edsoncarvalhointuria/merged-schema-forg-ai", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/edsoncarvalhointuria/merged-schema-forg-ai
- SGLang
How to use edsoncarvalhointuria/merged-schema-forg-ai 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 "edsoncarvalhointuria/merged-schema-forg-ai" \ --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": "edsoncarvalhointuria/merged-schema-forg-ai", "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 "edsoncarvalhointuria/merged-schema-forg-ai" \ --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": "edsoncarvalhointuria/merged-schema-forg-ai", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use edsoncarvalhointuria/merged-schema-forg-ai with Docker Model Runner:
docker model run hf.co/edsoncarvalhointuria/merged-schema-forg-ai
Schema Forg AI
Overview
Schema Forg AI is a specialized language model designed to generate production-ready API schemas using the @asteasolutions/zod-to-openapi library.
Unlike generic code generation models, Schema Forg AI was specifically fine-tuned to understand the relationship between JSON structures, OpenAPI specifications, and Zod schemas, producing code compatible with the zod-to-openapi ecosystem.
The goal of the project is to simplify API documentation workflows by generating a single source of truth based on Zod, from which OpenAPI JSON and YAML specifications can be automatically exported.
What the model can do
The model can generate:
- Zod schemas
@asteasolutions/zod-to-openapicode- OpenAPI JSON
- OpenAPI YAML
Starting from inputs such as:
- Raw JSON
- Existing OpenAPI specifications
- API endpoint definitions
- Structured objects
Why this model?
The JavaScript ecosystem already provides excellent tools such as @asteasolutions/zod-to-openapi, but creating high-quality schemas manually is still repetitive and time-consuming.
Schema Forg AI was created to automate this process using a domain-specific language model trained exclusively for API schema generation.
Training
The model was fine-tuned on thousands of synthetic examples covering:
- JSON โ Zod
- JSON โ zod-to-openapi
- Zod โ OpenAPI
- OpenAPI โ Zod
- OpenAPI JSON
- OpenAPI YAML
The dataset emphasizes:
- Nested objects
- Arrays
- Enums
- Validation rules
- Nullable fields
- Optional properties
- API endpoints
- Request/Response schemas
- Components
- Parameters
Intended Use
This model is intended for developers working with:
- TypeScript
- Zod
- @asteasolutions/zod-to-openapi
- OpenAPI
- REST APIs
- Backend development
Limitations
This model is highly specialized.
It performs best on API schema generation and conversion tasks and should not be considered a general-purpose coding assistant.
Author
Developed by Edson Carvalho Inturia as an educational research project exploring synthetic dataset generation, LoRA fine-tuning, and specialized language models for API development.
- Downloads last month
- 19
Model tree for edsoncarvalhointuria/merged-schema-forg-ai
Base model
microsoft/Phi-3-mini-4k-instruct