Skip to main content

DSL for Generative AI Prototyping

Project description

QType

QType is a domain-specific language (DSL) for rapid prototyping of AI applications.
It is designed to help developers define modular, composable AI systems using a structured YAML-based specification. QType supports models, prompts, tools, retrievers, and flow orchestration, and is extensible for code generation or live interpretation.


🚀 Quick Start

Install QType:

pip install qtype[interpreter]

Create a file hello_world.qtype.yaml that answers a question:

id: hello_world
flows:
  - id: chat_example
    description: A simple chat flow with OpenAI
    mode: Chat
    steps:
      - id: llm_inference_step
        model: 
          id: gpt-4
          provider: openai
          auth: 
            id: openai_auth
            type: api_key
            api_key: ${OPENAI_KEY}
        system_message: |
          You are a helpful assistant.
        inputs:
          - id: user_message
            type: ChatMessage
        outputs:
          - id: response
            type: ChatMessage

Put your openai api key into your .env file:

echo "OPENAI_KEY=sk...." >> .env

Validate it's semantic correctness:

qtype validate hello_world.qtype.yaml 

You should see:

INFO: ✅ Schema validation successful.
INFO: ✅ Model validation successful.
INFO: ✅ Language validation successful
INFO: ✅ Semantic validation successful

Launch the interpreter:

qtype serve hello_world.qtype.yaml`

And go to http://localhost:8000/ui to see the user interface for your application:

Example UI


See the full docs for more examples and guides.

✨ Developing with AI?

Use the QType MCP server to speed yourself up! Just set your assistant to run qtype mcp.

For VSCode, just add the following to .vscode/mcp.json:

{
  "servers": {
    "qtype": {
      "type": "stdio",
      "command": "qtype",
      "cwd": "${workspaceFolder}",
      "args": ["mcp", "--transport", "stdio"]
    }
  }
}

For Claude Code:

claude mcp add qtype -- qtype mcp --transport stdio"

🤝 Contributing

Contributions welcome! Please follow the instructions in the contribution guide.

📄 License

This project is licensed under the MIT License.
See the LICENSE file for details.


🧠 Philosophy

QType is built around modularity, traceability, and rapid iteration. It aims to empower developers to quickly scaffold ideas into usable AI applications without sacrificing maintainability or control.

Stay tuned for upcoming features like:

  • Integrated OpenTelemetry tracing
  • Validation via LLM-as-a-judge
  • UI hinting via input display types
  • Flow state switching and conditional routing

Happy hacking with QType! 🛠️

Generate JSON Schema Publish to PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qtype-0.1.17.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qtype-0.1.17-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file qtype-0.1.17.tar.gz.

File metadata

  • Download URL: qtype-0.1.17.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qtype-0.1.17.tar.gz
Algorithm Hash digest
SHA256 297926ceedd09bf99d17d0f8a0b1e7a2322eae245c5b2762c15272472dee56a3
MD5 928c8e06d25cdb75f701d1cebaaf2ec0
BLAKE2b-256 cce4202d76b087512e5a5d4ea36bf68fbcd89573edda7b21cfbd86513169b065

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtype-0.1.17.tar.gz:

Publisher: publish-pypi.yml on bazaarvoice/qtype

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qtype-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: qtype-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qtype-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 7fd84eb9d163285d3b2014c4fc57d944ded00809818bea61e6aa7c0a418d91ce
MD5 b205ef83c77d493b71eb8d61c4bf4cb0
BLAKE2b-256 84d940278ebf72c1acefdd188ff32cd7e3e4281133cb3c40a089b0ec96839be7

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtype-0.1.17-py3-none-any.whl:

Publisher: publish-pypi.yml on bazaarvoice/qtype

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page