GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aiscriptdev/aiscript: AIScript is a unique combination of interpreter programming language and web framework, both written in Rust, designed to help developers build AI applications effortlessly.

BranchesTags
Open more actions menu

Latest commit

 

History

409 Commits
409 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.github
.github
 
 
.vscode
.vscode
 
 
aiscript-arena
aiscript-arena
 
 
aiscript-common
aiscript-common
 
 
aiscript-derived
aiscript-derived
 
 
aiscript-directive
aiscript-directive
 
 
aiscript-lexer
aiscript-lexer
 
 
aiscript-runtime
aiscript-runtime
 
 
aiscript-vm
aiscript-vm
 
 
aiscript
aiscript
 
 
assets
assets
 
 
examples
examples
 
 
tests
tests
 
 
xtask
xtask
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
dist-workspace.toml
dist-workspace.toml
 
 
publish.sh
publish.sh
 
 

Repository files navigation

AIScript Logo

AIScript

The next generation language for human and AI.

https://aiscript.dev

License Discord

Introduction

AIScript is a unique combination of interpreter programming language and web framework, both written in Rust, designed to help developers build AI applications effortlessly. The language syntax draws inspiration from Python, JavaScript, and Rust, combining their strengths to create something that's intuitive, powerful, and easy to use.

Warning

AIScript is in early development. Please do not use it in production yet.

Programming Language

As a programming language, AIScript is built with a custom interpreter from the ground up:

  • Functions are first-class citizens with support for object-oriented programming paradigms
  • Built-in AI primitives, including prompt, AI functions, and agent capabilities
  • Dynamic typing system with targeted static type checking for improved safety
  • Built-in data validation similar to Python's Pydantic
  • Simple yet powerful error handling, inspired by Rust, Go, and Zig
  • Rich standard library leveraging Rust's ecosystem underneath
  • Automatic garbage collection for memory management

Web Framework

AIScript isn't just a language—it's a complete web development solution:

  • Elegant and intuitive route DSL for defining endpoints
  • Automatic parameter validation with clear error messages
  • Automatic OpenAPI schema and documentation generation
  • Built on Rust's best practices, using axum and sqlx under the hood
  • Combines Rust's axum performance with Python's Flask-like simplicity
  • Built-in database modules (std.db.pg and std.db.redis)
  • Built-in authentication and social login capabilities
  • Battery-included features easily enabled through simple configuration

How AIScript works

$ export OPENAI_API_KEY=<your-openai-api-key>

$ cat web.ai
get / {
    """An api to ask LLM"""

    query {
        """the question to ask"""
        @string(min_len=3, max_len=100) // validate params with builtin directive @string
        question: str
    }

    // `ai` and `prompt` are keywords
    ai fn ask(question: str) -> str {
        let answer = prompt question;
        return answer;
    }

    // use query.name or query["name"] to access query parameter
    let answer = ask(query.question);
    return { answer };
}

$ aiscript serve web.ai
Listening on http://localhost:8080

$ curl http://localhost:8080
{
    "error": "Missing required field: question"
}

$ curl http://localhost:8080?question=Hi
{
    "error": "Field validation failed: question: String length is less than the minimum length of 3"
}

$ curl http://localhost:8080?question=What is the capital of France?
{
    "answer": "The capital of France is Paris."
}

You can open http://localhost:8080/redoc to see the automatically generated API documentation.

Use Cases

AIScript excels in these scenarios:

  • AI-powered APIs: When you need to build APIs that leverage LLMs and other AI services
  • Prototyping: Rapidly build and test ideas without configuration overhead
  • Microservices: Create lightweight, focused services with minimal boilerplate
  • Data validation: When request/response validation is critical to your application
  • Internal tools: Build tools quickly with integrated documentation

Examples

Check out the examples directory for more sample code.

Supported AI Models

AIScript supports the following AI models:

  • OpenAI (uses OPENAI_API_KEY environment variable by default or local models with Ollama)
  • DeepSeek
  • Anthropic
  • Ollama (100+ local models from various providers)

Configuration by project.toml:

# use OpenAI
[ai.openai]
api_key = "YOUR_API_KEY"
model = "gpt-4"

# or use DeepSeek
[ai.deepseek]
api_key = "YOUR_API_KEY"
model = "deepseek-chat"

# or use Anthropic
[ai.anthropic]
api_key = "YOUR_API_KEY"
model = "claude-3-5-sonnet-latest"

# or use Ollama (local models)
[ai.ollama]
api_endpoint = "http://localhost:11434/v1"  # Default Ollama endpoint
model = "llama3.2"  # or any other model installed in your Ollama instance

Using Ollama

Ollama allows you to run local AI models on your own hardware. To use Ollama with AIScript:

  1. Install Ollama from ollama.ai
  2. Pull your desired models (e.g., ollama pull llama3.2)
  3. Make sure Ollama is running locally
  4. Configure AIScript to use Ollama as shown above or by setting the OLLAMA_API_ENDPOINT environment variable.

Ollama provides access to 100+ models ranging from small 135M parameter models to massive 671B parameter models, including:

  • Llama family (llama4, llama3.2, codellama)
  • DeepSeek models (deepseek-r1, deepseek-v3)
  • And many more specialized models

Roadmap

See our roadmap for upcoming features and improvements.

Contributing

We welcome contributions to AIScript! Please see our Contribution Guide for more information.

License

AIScript is released under the MIT License. See LICENSE for details.

About

AIScript is a unique combination of interpreter programming language and web framework, both written in Rust, designed to help developers build AI applications effortlessly.

aiscript.dev

Topics

ai-appintepreterrustweb-framework

Resources

Readme
MIT license
Activity
Custom properties

Stars

321 stars

Watchers

3 watching

Forks

22 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.